Conventional Commits Code Climate Issue Count Build Status Join the chat at https://gitter.im/elastic_map/Lobby

ElasticMap is an ODM for Elasticsearch and query DSL in a OO style.

Why ElasticMap?

TODO: Write why ElasticMap here


Add this line to your application's Gemfile:

gem 'elastic_map'

And then execute:

$ bundle

Or install it yourself as:

$ gem install elastic_map


Client settings

There are two ways to configure the ElasticMap client: the ElasticMap.settings hash and elastic_map.yml

# config/initializers/elastic_map.rb
ElasticMap.settings = {host: 'localhost:9250'} # do not use environments
# config/elastic_map.yml
# separate environment configs
  host: 'localhost:9250'
  prefix: 'test'
  host: 'localhost:9200'

The logger may be set explicitly:

ElasticMap.logger = Logger.new(STDOUT)

See config.rb for more details.


After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.



Bug reports and pull requests are welcome on GitHub at https://github.com/adham90/elastic_map. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.


The gem is available as open source under the terms of the MIT License.