{"id":13735273,"url":"https://github.com/rsolr/rsolr","last_synced_at":"2025-10-19T21:40:20.311Z","repository":{"id":463352,"uuid":"87821","full_name":"rsolr/rsolr","owner":"rsolr","description":"A Ruby client for Apache Solr","archived":false,"fork":false,"pushed_at":"2024-03-25T21:10:08.000Z","size":64110,"stargazers_count":422,"open_issues_count":23,"forks_count":142,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-10-17T10:54:34.035Z","etag":null,"topics":["ruby","solr"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsolr.png","metadata":{"files":{"readme":"README.rdoc","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2008-12-09T20:49:50.000Z","updated_at":"2025-10-07T01:36:37.000Z","dependencies_parsed_at":"2024-06-18T12:27:50.250Z","dependency_job_id":"c994568e-c79a-4984-92e0-28f446b43f08","html_url":"https://github.com/rsolr/rsolr","commit_stats":{"total_commits":744,"total_committers":57,"mean_commits":"13.052631578947368","dds":"0.43682795698924726","last_synced_commit":"5eee5c552c2975d3ed2fd474ce3ec63f1ed24446"},"previous_names":["mwmitchell/rsolr"],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/rsolr/rsolr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsolr%2Frsolr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsolr%2Frsolr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsolr%2Frsolr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsolr%2Frsolr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsolr","download_url":"https://codeload.github.com/rsolr/rsolr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsolr%2Frsolr/sbom","scorecard":{"id":787494,"data":{"date":"2025-08-11","repo":{"name":"github.com/rsolr/rsolr","commit":"a60ec42b58f3b068f23537e49d0b6510bb12ee17"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Code-Review","score":8,"reason":"Found 12/15 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ruby.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ruby.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/rsolr/rsolr/ruby.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ruby.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/rsolr/rsolr/ruby.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T06:28:19.112Z","repository_id":463352,"created_at":"2025-08-23T06:28:19.112Z","updated_at":"2025-08-23T06:28:19.112Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279771197,"owners_count":26224086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-19T02:00:07.647Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby","solr"],"created_at":"2024-08-03T03:01:04.932Z","updated_at":"2025-10-19T21:40:20.278Z","avatar_url":"https://github.com/rsolr.png","language":"Ruby","funding_links":[],"categories":["Clients","Full Text Search, Information Retrieval, Indexing"],"sub_categories":["Ruby","Text-to-Speech-to-Text"],"readme":"=RSolr\n\nA simple, extensible Ruby client for Apache Solr.\n\n==Documentation\nThe code docs http://www.rubydoc.info/gems/rsolr\n\n== Installation:\n  gem install rsolr\n\n== Example:\n  require 'rsolr'\n\n  # Direct connection\n  solr = RSolr.connect :url =\u003e 'http://solrserver.com'\n\n  # Connecting over a proxy server\n  solr = RSolr.connect :url =\u003e 'http://solrserver.com', :proxy=\u003e'http://user:pass@proxy.example.com:8080'\n\n  # Using an alternate Faraday adapter\n  solr = RSolr.connect :url =\u003e 'http://solrserver.com', :adapter =\u003e :em_http\n\n  # Using a custom Faraday connection\n  conn = Faraday.new do |faraday|\n    faraday.response :logger                  # log requests to STDOUT\n    faraday.adapter  Faraday.default_adapter  # make requests with Net::HTTP\n  end\n  solr = RSolr.connect conn, :url =\u003e 'http://solrserver.com'\n\n  # send a request to /select\n  response = solr.get 'select', :params =\u003e {:q =\u003e '*:*'}\n\n  # send a request to /catalog\n  response = solr.get 'catalog', :params =\u003e {:q =\u003e '*:*'}\n\nWhen the Solr +:wt+ is +:ruby+, then the response will be a Hash. This Hash is the same object returned by Solr, but evaluated as Ruby. If the +:wt+ is not +:ruby+, then the response will be a String.\n\nThe response also exposes 2 attribute readers (for any +:wt+ value), +:request+ and +:response+. Both are Hash objects with symbolized keys.\n\nThe +:request+ attribute contains the original request context. You can use this for debugging or logging. Some of the keys this object contains are +:uri+, +:query+, +:method+ etc..\n\nThe +:response+ attribute contains the original response. This object contains the +:status+, +:body+ and +:headers+ keys.\n\n== Request formats\n\nBy default, RSolr uses the Solr JSON command format for all requests.\n\n  RSolr.connect :url =\u003e 'http://solrserver.com', update_format: :json # the default\n  # or\n  RSolr.connect :url =\u003e 'http://solrserver.com', update_format: :xml\n\n== Timeouts\nThe read and connect timeout settings can be set when creating a new instance of RSolr, and will\nbe passed on to underlying Faraday instance:\n\n  solr = RSolr.connect(:timeout =\u003e 120, :open_timeout =\u003e 120)\n\n== Retry 503s\nA 503 is usually a temporary error which RSolr may retry if requested. You may specify the number of retry attempts with the +:retry_503+ option.\n\nOnly requests which specify a Retry-After header will be retried, after waiting the indicated retry interval, otherwise RSolr will treat the request as a 500. You may specify a maximum Retry-After interval to wait with the +:retry_after_limit+ option (default: one second).\n  solr = RSolr.connect(:retry_503 =\u003e 1, :retry_after_limit =\u003e 1)\n\nFor additional control, consider using a custom Faraday connection (see above) using its `retry` middleware.\n\n== Querying\nUse the #get / #post method to send search requests to the /select handler:\n  response = solr.get 'select', :params =\u003e {\n    :q=\u003e'washington',\n    :start=\u003e0,\n    :rows=\u003e10\n  }\n  response[\"response\"][\"docs\"].each{|doc| puts doc[\"id\"] }\n\nThe +:params+ sent into the method are sent to Solr as-is, which is to say they are converted to Solr url style, but no special mapping is used.\nWhen an array is used, multiple parameters *with the same name* are generated for the Solr query. Example:\n\n  solr.get 'select', :params =\u003e {:q=\u003e'roses', :fq=\u003e['red', 'violet']}\n\nThe above statement generates this Solr query:\n\n  select?q=roses\u0026fq=red\u0026fq=violet\n\n===Pagination\nTo paginate through a set of Solr documents, use the paginate method:\n  solr.paginate 1, 10, \"select\", :params =\u003e {:q =\u003e \"test\"}\n\nThe first argument is the current page, the second is how many documents to return for each page. In other words, \"page\" is the \"start\" Solr param and \"per-page\" is the \"rows\" Solr param.\n\nThe paginate method returns WillPaginate ready \"docs\" objects, so for example in a Rails application, paginating is as simple as:\n  \u003c%= will_paginate @solr_response[\"response\"][\"docs\"] %\u003e\n\n===Method Missing\nThe +RSolr::Client+ class also uses +method_missing+ for setting the request handler/path:\n\n  solr.paintings :params =\u003e {:q=\u003e'roses', :fq=\u003e['red', 'violet']}\n\nThis is sent to Solr as:\n  paintings?q=roses\u0026fq=red\u0026fq=violet\n\nThis works with pagination as well:\n\n  solr.paginate_paintings 1, 10, {:q=\u003e'roses', :fq=\u003e['red', 'violet']}\n\n===Using POST for Search Queries\nThere may be cases where the query string is too long for a GET request. RSolr solves this issue by converting hash objects into form-encoded strings:\n  response = solr.music :data =\u003e {:q =\u003e \"*:*\"}\n\nThe +:data+ hash is serialized as a form-encoded query string, and the correct content-type headers are sent along to Solr.\n\n===Sending HEAD Requests\nThere may be cases where you'd like to send a HEAD request to Solr:\n  solr.head(\"admin/ping\").response[:status] == 200\n\n==Sending HTTP Headers\nSolr responds to the request headers listed here: http://wiki.apache.org/solr/SolrAndHTTPCaches\nTo send header information to Solr using RSolr, just use the +:headers+ option:\n  response = solr.head \"admin/ping\", :headers =\u003e {\"Cache-Control\" =\u003e \"If-None-Match\"}\n\n===Building a Request\n+RSolr::Client+ provides a method for building a request context, which can be useful for debugging or logging etc.:\n  request_context = solr.build_request \"select\", :data =\u003e {:q =\u003e \"*:*\"}, :method =\u003e :post, :headers =\u003e {}\n\nTo build a paginated request use build_paginated_request:\n  request_context = solr.build_paginated_request 1, 10, \"select\", ...\n\n== Updating Solr\nUpdating is done using native Ruby objects. Hashes are used for single documents and arrays are used for a collection of documents (hashes). These objects get turned into simple XML \"messages\". Raw XML strings can also be used.\n\nSingle document via #add\n  solr.add :id=\u003e1, :price=\u003e1.00\n\nMultiple documents via #add\n  documents = [{:id=\u003e1, :price=\u003e1.00}, {:id=\u003e2, :price=\u003e10.50}]\n  solr.add documents\n\nThe optional +:add_attributes+ hash can also be used to set Solr \"add\" document attributes:\n  solr.add documents, :add_attributes =\u003e {:commitWithin =\u003e 10}\n\nRaw commands via  #update\n  solr.update data: '\u003ccommit/\u003e', headers: { 'Content-Type' =\u003e 'text/xml' }\n  solr.update data: { optimize: true }.to_json, headers: { 'Content-Type' =\u003e 'application/json' }\n\nWhen adding, you can also supply \"add\" xml element attributes and/or a block for manipulating other \"add\" related elements (docs and fields) by calling the +xml+ method directly:\n\n  doc = {:id=\u003e1, :price=\u003e1.00}\n  add_attributes = {:allowDups=\u003efalse, :commitWithin=\u003e10}\n  add_xml = solr.xml.add(doc, add_attributes) do |doc|\n    # boost each document\n    doc.attrs[:boost] = 1.5\n    # boost the price field:\n    doc.field_by_name(:price).attrs[:boost] = 2.0\n  end\n\nNow the \"add_xml\" object can be sent to Solr like:\n  solr.update :data =\u003e add_xml\n\n===Deleting\nDelete by id\n  solr.delete_by_id 1\nor an array of ids\n  solr.delete_by_id [1, 2, 3, 4]\n\nDelete by query:\n  solr.delete_by_query 'price:1.00'\nDelete by array of queries\n  solr.delete_by_query ['price:1.00', 'price:10.00']\n\n===Commit / Optimize\n  solr.commit, :commit_attributes =\u003e {}\n  solr.optimize, :optimize_attributes =\u003e {}\n\n== Response Formats\nThe default response format is Ruby. When the +:wt+ param is set to +:ruby+, the response is eval'd resulting in a Hash. You can get a raw response by setting the +:wt+ to +\"ruby\"+ - notice, the string -- not a symbol. RSolr will eval the Ruby string ONLY if the :wt value is :ruby. All other response formats are available as expected, +:wt=\u003e'xml'+ etc..\n\n===Evaluated Ruby:\n  solr.get 'select', :params =\u003e {:wt =\u003e :ruby} # notice :ruby is a Symbol\n===Raw Ruby:\n  solr.get 'select', :params =\u003e {:wt =\u003e 'ruby'} # notice 'ruby' is a String\n===XML:\n  solr.get 'select', :params =\u003e {:wt =\u003e :xml}\n===JSON (default):\n  solr.get 'select', :params =\u003e {:wt =\u003e :json}\n\n==Related Resources \u0026 Projects\n* {RSolr Google Group}[http://groups.google.com/group/rsolr] -- The RSolr discussion group\n* {rsolr-ext}[http://github.com/mwmitchell/rsolr-ext] -- An extension kit for RSolr\n* {rsolr-direct}[http://github.com/mwmitchell/rsolr-direct] -- JRuby direct connection for RSolr\n* {rsolr-nokogiri}[http://github.com/mwmitchell/rsolr-nokogiri] -- Gives RSolr Nokogiri for XML generation.\n* {SunSpot}[http://github.com/sunspot/sunspot] -- An awesome Solr DSL, built with RSolr\n* {Blacklight}[http://blacklightopac.org] -- A \"next generation\" Library OPAC, built with RSolr\n* {java_bin}[http://github.com/kennyj/java_bin] -- Provides javabin/binary parsing for RSolr\n* {Solr}[http://lucene.apache.org/solr/] -- The Apache Solr project\n* {solr-ruby}[http://wiki.apache.org/solr/solr-ruby] -- The original Solr Ruby Gem!\n\n== Note on Patches/Pull Requests\n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so I don't break it in a future version unintentionally.\n* Commit, do not mess with rakefile, version, or history\n  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)\n* Send me a pull request. Bonus points for topic branches.\n\n==Contributors\n* Nathan Witmer\n* Magnus Bergmark\n* shima\n* Randy Souza\n* Mat Brown\n* Jeremy Hinegardner\n* Denis Goeury\n* shairon toledo\n* Rob Di Marco\n* Peter Kieltyka\n* Mike Perham\n* Lucas Souza\n* Dmitry Lihachev\n* Antoine Latter\n* Naomi Dushay\n\n==Author\n\nMatt Mitchell \u003cmailto:goodieboy@gmail.com\u003e\n\n==Copyright\n\nCopyright (c) 2008-2010 Matt Mitchell. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsolr%2Frsolr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsolr%2Frsolr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsolr%2Frsolr/lists"}