:shell: ElasticMap

Conventional Commits Build Status Join the chat at https://gitter.im/elastic_map/Lobby Dependency Status Inline docs

ElasticMap ODM (Object-Document-Mapper) is a mongoid-like gem for Elasticsearch that provides the functionality of chainable queries, embedding indexes, relations, and aggregations.

Installation

Add this line to your application's Gemfile:

gem 'elastic_map'

And then execute:

$ bundle

Or install it yourself as:

$ gem install elastic_map

Usage

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
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.

Development

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.

TODO

Contributing

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.

License

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