Elasticsearch support for rom-rb.
Resources:
Changes in this fork:
- Gemspec updated to support latest elasticsearch gems and servers (7.x)
- New scaled_float type to support e.g.money fields
- Removes the use of types in indexes https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html
- Possibility to initialize gateway with existing elasticsearch client / http libraries
transport_options = {request: { timeout: 60 }} # faraday request timeout, in seconds
host = ENV['ELASTICSEARCH_URL'] ? ENV['ELASTICSEARCH_URL'] : "localhost"
port = ENV['ELASTICSEARCH_PORT'] ? ENV['ELASTICSEARCH_PORT'] : 9200
client = Elasticsearch::Client.new transport_options: transport_options, host: host, port: port, retry_on_failure: true, log: false, trace: false do |f|
f.use Faraday::Request::Multipart
f.use Faraday::Request::UrlEncoded
f.use Faraday::Response::RaiseError
f.adapter :typhoeus
end
conf = ROM::Configuration.new(:elasticsearch, client)
Add this line to your application's Gemfile:
gem 'rom-elasticsearch'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rom-elasticsearch
See LICENSE
file.