https://github.com/elastic/enterprise-search-ruby
Official Ruby client for Elastic Enterprise Search, App Search, and Workplace Search
https://github.com/elastic/enterprise-search-ruby
app-search appsearch client elastic-app-search elastic-enterprise-search elastic-workplace-search enterprise-search ruby workplace-search
Last synced: about 2 months ago
JSON representation
Official Ruby client for Elastic Enterprise Search, App Search, and Workplace Search
- Host: GitHub
- URL: https://github.com/elastic/enterprise-search-ruby
- Owner: elastic
- License: apache-2.0
- Created: 2020-08-10T16:13:05.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-05T11:09:17.000Z (3 months ago)
- Last Synced: 2025-03-28T12:09:23.115Z (about 2 months ago)
- Topics: app-search, appsearch, client, elastic-app-search, elastic-enterprise-search, elastic-workplace-search, enterprise-search, ruby, workplace-search
- Language: Ruby
- Homepage: https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/index.html
- Size: 922 KB
- Stars: 20
- Watchers: 196
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT
Awesome Lists containing this project
README
# Elastic Enterprise Search Client

[](https://github.com/rubocop-hq/rubocop)

[](https://buildkite.com/elastic/enterprise-search-ruby)Official Ruby API client for [Elastic Enterprise Search](https://www.elastic.co/enterprise-search). Use this gem to integrate App Search and Workplace Search into your Ruby code.
## Installation
Install the `elastic-enterprise-search` gem from [Rubygems](https://rubygems.org/gems/elastic-enterprise-search):
```
$ gem install elastic-enterprise-search
```Or add it to your project's Gemfile:
```ruby
gem 'elastic-enterprise-search', 'VERSION'
```The Enterprise Search client is implemented with [`elastic-transport`](https://github.com/elastic/elastic-transport-ruby/) as the HTTP layer, which uses [Faraday](https://rubygems.org/gems/faraday). Faraday supports several [adapters](https://lostisland.github.io/faraday/adapters/) and will use `Net::HTTP` by default. For optimal performance with the Enterprise Search API, we suggest using an HTTP library which supports persistent ("keep-alive") connections. For the standard Ruby implementation, this could be [Net::HTTP::Persistent](https://github.com/drbrain/net-http-persistent), [patron](https://github.com/toland/patron) or [Typhoeus](https://github.com/typhoeus/typhoeus). For JRuby, [Manticore](https://github.com/cheald/manticore) is a great option as well. Require the library for the adapter in your code and then pass in the `:adapter` parameter to the client when you initialize it:
```ruby
require 'elastic-enterprise-search'
require 'faraday/net_http_persistent'client = Elastic::EnterpriseSearch::Client.new(adapter: :net_http_persistent)
```
If an adapter is not specified, the client will try to auto-detect available libraries and use the best available HTTP client.## Documentation
[See the documentation](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/index.html) for usage, code examples, configuring the client, and an API reference.
See code examples of usage for the [Enterprise Search](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/enterprise-search-api.html), [App Search](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/app-search-api.html) and [Workplace Search](https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current/workplace-search-api.html) APIs.
## Compatibility
We follow Ruby’s own maintenance policy and officially support all currently maintained versions per [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/).
## Development
See [CONTRIBUTING](https://github.com/elastic/enterprise-search-ruby/blob/main/CONTRIBUTING.md).
## License
This software is licensed under the [Apache 2 license](./LICENSE). See [NOTICE](./NOTICE).