ElasticMap ODM (Object-Document-Mapper) is a mongoid-like gem for Elasticsearch that provides the functionality of chainable queries, embedding indexes, relations, and aggregations.
Add this line to your application's Gemfile:
gem 'elastic_map'
And then execute:
$ bundle
Or install it yourself as:
$ gem install elastic_map
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
test:
host: 'localhost:9250'
prefix: 'test'
development:
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.
- Configrations and settings
- Create Index base class
- Object mapper
- Query DSL
- Query helpers
- Relations
- Embedding
- Aggregations
- Analyzer
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.