https://github.com/elastic/elasticsearch-ruby
Ruby integrations for Elasticsearch
https://github.com/elastic/elasticsearch-ruby
Keywords
client elastic elasticsearch ruby rubynlp search
Keywords from Contributors
activerecord activejob mvc rubygem rspec rack crash-reporting activemodel rubocop ruby-gem
Last synced: about 13 hours ago
JSON representation
Repository metadata
Ruby integrations for Elasticsearch
- Host: GitHub
- URL: https://github.com/elastic/elasticsearch-ruby
- Owner: elastic
- License: apache-2.0
- Created: 2013-05-03T07:39:25.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2025-12-03T09:55:35.000Z (7 days ago)
- Last Synced: 2025-12-06T16:57:20.600Z (4 days ago)
- Topics: client, elastic, elasticsearch, ruby, rubynlp, search
- Language: Ruby
- Homepage: https://www.elastic.co/docs/reference/elasticsearch/clients/ruby
- Size: 17.8 MB
- Stars: 1,979
- Watchers: 349
- Forks: 614
- Open Issues: 9
- Releases: 107
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT
- Notice: NOTICE
README.md
Elasticsearch
Download the latest version of Elasticsearch
or
sign-up
for a free trial of Elastic Cloud.
This repository contains the official Elasticsearch Ruby client. The elasticsearch gem is a complete Elasticsearch client which uses two separate libraries:
elastic-transport- provides the low-level code for connecting to an Elasticsearch cluster.elasticsearch-api- provides a Ruby API for the Elasticsearch RESTful API.
Documentation
Please refer to
the full documentation on elastic.co
for comprehensive information.
Both elastic-transport and elasticsearch-api are documented. You can check
the elastic-transport
and the elasticsearch-api
documentation at RubyDocs.
Installation
gem install elasticsearch
Refer to the Installation section
of the getting started documentation.
Connecting
Refer to the Connecting section
of the getting started documentation.
Usage
require 'elasticsearch'
client = Elasticsearch::Client.new(host: 'https://my-elasticsearch-host.example')
client.ping
client.search(q: 'test')
- Creating an index
- Indexing a document
- Getting documents
- Searching documents
- Updating documents
- Deleting documents
- Deleting an index
Refer to the official documentation
for examples of how to use the most frequently called APIs and
doc/examples
for some practical examples.
For optimal performance, you should use a HTTP library which supports persistent ("keep-alive") connections, e.g. Patron or Typhoeus. These libraries are not dependencies of the Elasticsearch gems. Ensure you define a dependency for a HTTP library in your own application.
Check out these other official Ruby libraries for working with Elasticsearch:
elasticsearch-rails- integration with Ruby models and Rails applications.elasticsearch-extensions, deprecated.elasticsearch-dslwhich provides a Ruby API for the Elasticsearch Query DSL.
Please see their respective READMEs for information and documentation.
Compatibility
We follow Ruby’s own maintenance policy and officially support all currently maintained versions per Ruby Maintenance Branches.
Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch without breaking.
It does not mean that the client automatically supports new features of newer Elasticsearch versions; it is only possible after a release of a new client version.
For example, a 8.12 client version won't automatically support the new features of the 8.13 version of Elasticsearch, the 8.13 client version is required for that.
Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
| Gem Version | Elasticsearch Version | Supported | |
|---|---|---|---|
| 8.x | → | 8.x | 8.x |
| 9.x | → | 9.x | 9.x |
| main | → | main |
Try Elasticsearch and Kibana locally
If you want to try Elasticsearch and Kibana locally, you can run the following command:
curl -fsSL https://elastic.co/start-local | sh
This will run Elasticsearch at http://localhost:9200 and Kibana at http://localhost:5601 using Docker.
More information is available here.
Development
See CONTRIBUTING.
License
This software is licensed under the Apache 2 license. See NOTICE.
Owner metadata
- Name: elastic
- Login: elastic
- Email: info@elastic.co
- Kind: organization
- Description:
- Website: https://www.elastic.co/
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/6764390?v=4
- Repositories: 858
- Last ynced at: 2025-10-28T00:29:28.877Z
- Profile URL: https://github.com/elastic
GitHub Events
Total
- Fork event: 21
- Create event: 261
- Commit comment event: 1
- Release event: 13
- Issues event: 8
- Watch event: 29
- Delete event: 213
- Issue comment event: 199
- Public event: 1
- Push event: 690
- Pull request review comment event: 13
- Pull request review event: 65
- Pull request event: 482
Last Year
- Create event: 230
- Commit comment event: 1
- Release event: 12
- Issues event: 7
- Watch event: 19
- Delete event: 184
- Issue comment event: 171
- Push event: 592
- Pull request review comment event: 13
- Pull request review event: 57
- Pull request event: 422
- Fork event: 11
Committers metadata
Last synced: 4 days ago
Total Commits: 3,415
Total Committers: 171
Avg Commits per committer: 19.971
Development Distribution Score (DDS): 0.503
Commits in past year: 253
Committers in past year: 7
Avg Commits per committer in past year: 36.143
Development Distribution Score (DDS) in past year: 0.067
| Name | Commits | |
|---|---|---|
| Fernando Briano | f****o@p****t | 1698 |
| Karel Minarik | k****k@e****m | 945 |
| Emily Stolfo | e****o@g****m | 433 |
| Elastic Machine | e****e | 31 |
| Karel Minarik | k****k@e****o | 30 |
| István Zoltán Szabó | s****e@g****m | 15 |
| Colleen McGinnis | c****s@e****o | 9 |
| Joao Duarte | j****e@g****m | 9 |
| Karel Minarik | k****i@e****o | 8 |
| shields | j****s@g****m | 7 |
| Eugene Pirogov | i****e@g****m | 6 |
| dx7 | r****7@g****m | 5 |
| Stephen Prater | me@s****m | 5 |
| Kevin Kirsche | K****b@g****m | 5 |
| Philip Krauss | p****p@p****t | 4 |
| Hiroshi Hatake | h****e@c****m | 4 |
| Chris Koehnke | c****e@e****o | 4 |
| Haruki Hasegawa | h****0@g****m | 4 |
| Christos Trochalakis | y****i@i****r | 4 |
| Andrew Cholakian | a****w@a****m | 4 |
| Adam Fernung | a****n@g****m | 4 |
| Jon Dalberg | j****g@t****m | 3 |
| Tobias Pfeiffer | p****b@g****m | 3 |
| Trevor Creech | t****r@o****m | 3 |
| Marci W | 3****w | 3 |
| Mark Dodwell | m****c | 3 |
| Aaron Rustad | a****d@a****m | 2 |
| Joseph (Jy) Yaworski | j****i@c****s | 2 |
| Jan Calanog | n****g@g****m | 2 |
| kares | s****f@k****g | 2 |
| and 141 more... | ||
Committer domains:
- elastic.co: 16
- me.com: 2
- griffinonline.org: 1
- infonomics.ltd.uk: 1
- dio.jp: 1
- tobiasmaier.info: 1
- opencorporates.com: 1
- eab.com: 1
- i22.de: 1
- perfect-memory.com: 1
- benabrams.it: 1
- cisco.com: 1
- zerobearing.com: 1
- gaurishsharma.com: 1
- vinted.com: 1
- uqido.com: 1
- myfitnesspal.com: 1
- gocardless.com: 1
- picandocodigo.net: 1
- elasticsearch.com: 1
- stephenprater.com: 1
- philipkrauss.at: 1
- clear-code.com: 1
- ideopolis.gr: 1
- andrewvc.com: 1
- truecar.com: 1
- opendoor.com: 1
- anassina.com: 1
- carotid.us: 1
- kares.org: 1
- konklone.com: 1
- gurgel.me: 1
- bruckmayer.net: 1
- klinger.io: 1
- delvecch.io: 1
- skovik.com: 1
- intel.com: 1
- 163.com: 1
- koenpunt.nl: 1
- uni-koeln.de: 1
- julik.nl: 1
- manas.com.ar: 1
- duh.se: 1
- lostapathy.com: 1
- nornagon.net: 1
- jsmf.net: 1
- intercom.io: 1
- hugomelo.com: 1
- fleetio.com: 1
- peknet.com: 1
- kovyrin.net: 1
- brightbits.co.uk: 1
- chiprewards.com: 1
- mpr.org: 1
- riskified.com: 1
- weblinc.com: 1
- stacksocial.com: 1
- ansfederal.com: 1
- abletech.co.nz: 1
- paperlesspost.com: 1
- buyco.co: 1
- bookbub.com: 1
- identpro.de: 1
- cavvia.net: 1
- list.ru: 1
- soartec-lab.work: 1
- speee.jp: 1
- haryan.to: 1
- artirix.com: 1
- raphaelli.com: 1
Issue and Pull Request metadata
Last synced: 7 days ago
Total issues: 34
Total pull requests: 1,155
Average time to close issues: about 1 year
Average time to close pull requests: 2 days
Total issue authors: 22
Total pull request authors: 21
Average comments per issue: 2.47
Average comments per pull request: 0.63
Merged pull request: 937
Bot issues: 0
Bot pull requests: 2
Past year issues: 4
Past year pull requests: 457
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 1 day
Past year issue authors: 4
Past year pull request authors: 8
Past year average comments per issue: 2.0
Past year average comments per pull request: 0.64
Past year merged pull request: 370
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- picandocodigo (12)
- Bhumika2015 (2)
- rful011 (1)
- bkmgit (1)
- denisj (1)
- papanikge (1)
- Sinjo (1)
- elasticmachine (1)
- felixstackadapt (1)
- rafaltrojanowski (1)
- harikrishnaapc (1)
- ClearlyClaire (1)
- giovannelli (1)
- tye-singwa (1)
- dbackeus (1)
Top Pull Request Authors
- picandocodigo (747)
- elasticmachine (328)
- colleenmcginnis (18)
- szabosteve (16)
- marciw (8)
- estolfo (6)
- jrodewig (5)
- Mpdreamz (5)
- reakaleek (3)
- Earlopain (3)
- KOTungseth (2)
- cotti (2)
- elastic-renovate-prod[bot] (2)
- pquentin (2)
- rafaltrojanowski (2)
Top Issue Labels
- Skipped tests (6)
- 8.0 (5)
- question (5)
- CI (4)
- test-runner (3)
- 7.16 (3)
- feature request (2)
- waiting (1)
- elasticsearch-extensions (1)
- elasticsearch-api (1)
- bug (1)
- 9.x (1)
- investigation (1)
- backport (1)
- 8.x (1)
Top Pull Request Labels
- 9.x (201)
- elasticsearch-api (193)
- CI (185)
- 8.x (177)
- documentation (176)
- backport (105)
- test-runner (76)
- elasticsearch-gem (27)
- Skipped tests (23)
- 7.17 (17)
- release-branch (16)
- test (10)
- bug (10)
- feature (2)
Package metadata
- Total packages: 13
-
Total downloads:
- rubygems: 1,179,688,736 total
- Total docker downloads: 4,817,494,156
- Total dependent packages: 241 (may contain duplicates)
- Total dependent repositories: 20,318 (may contain duplicates)
- Total versions: 1,247
- Total maintainers: 6
gem.coop: elasticsearch-api
Ruby API for Elasticsearch. See the `elasticsearch` gem for full integration.
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch-api/
- Licenses: Apache-2.0
- Latest release: 9.2.0 (published about 1 month ago)
- Last Synced: 2025-12-07T23:31:11.769Z (3 days ago)
- Versions: 154
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 197,341,316 Total
- Docker Downloads: 795,729,980
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.06%
- Docker downloads count: 0.118%
- Downloads: 0.122%
- Maintainers (4)
gem.coop: elasticsearch
Ruby integrations for Elasticsearch (client, API, etc.)
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch/
- Licenses: Apache-2.0
- Latest release: 9.2.0 (published about 1 month ago)
- Last Synced: 2025-12-07T21:31:28.050Z (3 days ago)
- Versions: 155
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 196,454,970 Total
- Docker Downloads: 795,729,980
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.06%
- Docker downloads count: 0.118%
- Downloads: 0.122%
- Maintainers (4)
gem.coop: elasticsearch-transport
Ruby client for Elasticsearch. See the `elasticsearch` gem for full integration.
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/7.16/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch-transport/
- Licenses: Apache-2.0
- Latest release: 7.17.11 (published over 1 year ago)
- Last Synced: 2025-12-08T23:01:36.249Z (1 day ago)
- Versions: 106
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 164,543,938 Total
- Docker Downloads: 737,775,218
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.068%
- Docker downloads count: 0.124%
- Downloads: 0.149%
- Maintainers (3)
rubygems.org: elasticsearch
Ruby integrations for Elasticsearch (client, API, etc.)
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch/
- Licenses: Apache-2.0
- Latest release: 9.2.0 (published about 1 month ago)
- Last Synced: 2025-12-08T01:02:13.326Z (3 days ago)
- Versions: 156
- Dependent Packages: 197
- Dependent Repositories: 6,815
- Downloads: 196,460,079 Total
- Docker Downloads: 795,729,980
-
Rankings:
- Downloads: 0.119%
- Docker downloads count: 0.14%
- Dependent packages count: 0.19%
- Dependent repos count: 0.39%
- Average: 0.489%
- Forks count: 0.921%
- Stargazers count: 1.176%
- Maintainers (4)
gem.coop: elasticsearch-dsl
A Ruby DSL builder for Elasticsearch
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch-dsl/
- Licenses: Apache-2.0
- Latest release: 0.1.10 (published over 4 years ago)
- Last Synced: 2025-12-08T12:31:18.328Z (2 days ago)
- Versions: 12
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 16,883,921 Total
- Docker Downloads: 17,227,449
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.496%
- Downloads: 0.957%
- Docker downloads count: 1.028%
- Maintainers (3)
gem.coop: elasticsearch-xpack
Ruby integrations for the X-Pack extensions for Elasticsearch
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/7.16/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch-xpack/
- Licenses: Apache-2.0
- Latest release: 7.17.11 (published over 1 year ago)
- Last Synced: 2025-12-07T11:32:59.240Z (3 days ago)
- Versions: 57
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 3,253,521 Total
- Docker Downloads: 62,277,243
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Docker downloads count: 0.594%
- Average: 0.624%
- Downloads: 1.904%
- Maintainers (4)
gem.coop: elasticsearch-extensions
Extensions for the Elasticsearch Rubygem
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch-extensions/
- Licenses: Apache-2.0
- Latest release: 0.0.33 (published almost 5 years ago)
- Last Synced: 2025-12-08T12:01:07.797Z (2 days ago)
- Versions: 33
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 11,376,457 Total
- Docker Downloads: 7,208
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.765%
- Downloads: 1.122%
- Docker downloads count: 1.937%
- Maintainers (5)
rubygems.org: elasticsearch-api
Ruby API for Elasticsearch. See the `elasticsearch` gem for full integration.
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch-api/
- Licenses: Apache-2.0
- Latest release: 9.2.0 (published about 1 month ago)
- Last Synced: 2025-12-08T10:31:04.238Z (2 days ago)
- Versions: 155
- Dependent Packages: 8
- Dependent Repositories: 6,256
- Downloads: 197,368,338 Total
- Docker Downloads: 795,729,980
-
Rankings:
- Downloads: 0.118%
- Docker downloads count: 0.14%
- Dependent repos count: 0.408%
- Average: 0.799%
- Forks count: 0.917%
- Stargazers count: 1.169%
- Dependent packages count: 2.044%
- Maintainers (4)
rubygems.org: elasticsearch-transport
Ruby client for Elasticsearch. See the `elasticsearch` gem for full integration.
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/7.16/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch-transport/
- Licenses: Apache-2.0
- Latest release: 7.17.11 (published over 1 year ago)
- Last Synced: 2025-12-07T12:02:53.659Z (3 days ago)
- Versions: 106
- Dependent Packages: 6
- Dependent Repositories: 6,177
- Downloads: 164,495,162 Total
- Docker Downloads: 737,775,218
-
Rankings:
- Downloads: 0.138%
- Docker downloads count: 0.152%
- Dependent repos count: 0.41%
- Average: 0.878%
- Forks count: 0.917%
- Stargazers count: 1.169%
- Dependent packages count: 2.484%
- Maintainers (3)
rubygems.org: elasticsearch-extensions
Extensions for the Elasticsearch Rubygem
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch-extensions/
- Licenses: Apache-2.0
- Latest release: 0.0.33 (published almost 5 years ago)
- Last Synced: 2025-12-08T16:31:15.843Z (2 days ago)
- Versions: 33
- Dependent Packages: 23
- Dependent Repositories: 198
- Downloads: 11,377,113 Total
- Docker Downloads: 7,208
-
Rankings:
- Forks count: 0.912%
- Dependent packages count: 0.963%
- Downloads: 0.988%
- Stargazers count: 1.166%
- Average: 1.396%
- Docker downloads count: 2.17%
- Dependent repos count: 2.177%
- Maintainers (5)
rubygems.org: elasticsearch-dsl
A Ruby DSL builder for Elasticsearch
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch-dsl/
- Licenses: Apache-2.0
- Latest release: 0.1.10 (published over 4 years ago)
- Last Synced: 2025-12-07T21:31:31.182Z (3 days ago)
- Versions: 12
- Dependent Packages: 4
- Dependent Repositories: 606
- Downloads: 16,880,299 Total
- Docker Downloads: 17,227,449
-
Rankings:
- Downloads: 0.895%
- Forks count: 0.912%
- Docker downloads count: 1.125%
- Stargazers count: 1.166%
- Dependent repos count: 1.435%
- Average: 1.472%
- Dependent packages count: 3.3%
- Maintainers (3)
rubygems.org: elasticsearch-xpack
Ruby integrations for the X-Pack extensions for Elasticsearch
- Homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/7.16/index.html
- Documentation: http://www.rubydoc.info/gems/elasticsearch-xpack/
- Licenses: Apache-2.0
- Latest release: 7.17.11 (published over 1 year ago)
- Last Synced: 2025-12-08T04:02:06.041Z (2 days ago)
- Versions: 57
- Dependent Packages: 3
- Dependent Repositories: 266
- Downloads: 3,253,622 Total
- Docker Downloads: 62,277,243
-
Rankings:
- Docker downloads count: 0.709%
- Forks count: 0.915%
- Stargazers count: 1.165%
- Average: 1.788%
- Dependent repos count: 1.918%
- Downloads: 1.978%
- Dependent packages count: 4.044%
- Maintainers (4)
proxy.golang.org: github.com/elastic/elasticsearch-ruby
- Homepage:
- Documentation: https://pkg.go.dev/github.com/elastic/elasticsearch-ruby#section-documentation
- Licenses: apache-2.0
- Latest release: v9.2.0+incompatible (published about 1 month ago)
- Last Synced: 2025-12-06T23:02:28.328Z (4 days ago)
- Versions: 211
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 1.165%
- Stargazers count: 1.515%
- Average: 5.764%
- Dependent packages count: 9.576%
- Dependent repos count: 10.802%
Dependencies
- byebug >= 0 development
- rspec >= 0 development
- ansi >= 0
- cane >= 0
- mocha >= 0
- pry >= 0
- rake >= 0
- require-prof >= 0
- rubocop >= 0
- ruby-prof >= 0
- shoulda-context >= 0
- simplecov >= 0
- test-unit ~> 2
- yard >= 0
- pry >= 0 development
- ansi >= 0
- oj >= 0
- patron >= 0
- elastic-apm >= 0
- elasticsearch >= 0
- sinatra >= 0
- bunny >= 0
- elasticsearch >= 0
- multi_json >= 0
- oj >= 0
- bundler >= 0 development
- pry >= 0 development
- rake >= 0 development
- rspec >= 0 development
- simplecov >= 0 development
- webmock >= 0 development
- yard >= 0 development
- elastic-transport ~> 8
- elasticsearch-api = 8.4.0
- pry-byebug >= 0 development
- pry-nav >= 0 development
- rspec >= 0 development
- rspec_junit_formatter >= 0 development
- activesupport >= 0 development
- ansi >= 0 development
- bundler >= 0 development
- cane >= 0 development
- elasticsearch >= 0 development
- hashie >= 0 development
- jbuilder < 7.0.0 development
- jbuilder >= 0 development
- jsonify >= 0 development
- minitest >= 0 development
- minitest-reporters >= 0 development
- mocha >= 0 development
- pry >= 0 development
- rake >= 0 development
- shoulda-context >= 0 development
- simplecov >= 0 development
- test-unit ~> 2 development
- yard >= 0 development
- multi_json >= 0
- coderay >= 0
- json >= 0
- multi_json >= 0
- pry >= 0
- rubocop >= 0
- thor >= 0
- actions/checkout v2 composite
- ruby/setup-ruby v1 composite
- actions/checkout v2 composite
- elastic/elastic-github-actions/elasticsearch master composite
- ruby/setup-ruby v1 composite
- actions/checkout v2 composite
- ruby $RUBY_VERSION build
- ruby ${RUBY_TEST_VERSION} build
- ruby ${RUBY_VERSION} build
- docker.elastic.co/apm/apm-server ${STACK_VERSION}
- docker.elastic.co/elasticsearch/elasticsearch ${STACK_VERSION}
- docker.elastic.co/kibana/kibana ${STACK_VERSION}
- ruby 2.7 build
- ruby 2.7 build
Score: 35.25110762767511