https://github.com/adham90/elastic_map
:shell: ElasticMap is a read-only ODM (Object-Document-Mapper) framework for Elasticsearch in Ruby.
https://github.com/adham90/elastic_map
elasticsearch elasticsearch-client gem mapper odm ruby
Last synced: about 2 months ago
JSON representation
:shell: ElasticMap is a read-only ODM (Object-Document-Mapper) framework for Elasticsearch in Ruby.
- Host: GitHub
- URL: https://github.com/adham90/elastic_map
- Owner: adham90
- License: mit
- Created: 2017-06-15T01:00:34.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-29T17:48:30.000Z (about 9 years ago)
- Last Synced: 2025-03-21T15:11:16.962Z (over 1 year ago)
- Topics: elasticsearch, elasticsearch-client, gem, mapper, odm, ruby
- Language: Ruby
- Homepage: http://rubydoc.info/github/adham90/elastic_map
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# :shell: ElasticMap
[](https://conventionalcommits.org)
[](https://travis-ci.org/adham90/elastic_map)
[](https://gitter.im/elastic_map/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://gemnasium.com/github.com/adham90/elastic_map)
[](http://inch-ci.org/github/adham90/elastic_map)
ElasticMap ODM (Object-Document-Mapper) is a [mongoid](https://github.com/mongodb/mongoid)-like gem for [Elasticsearch](https://github.com/elastic/elasticsearch) that provides the functionality of chainable queries, embedding indexes, relations, and aggregations.
## Installation
Add this line to your application's Gemfile:
```ruby
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`
```ruby
# config/initializers/elastic_map.rb
ElasticMap.settings = {host: 'localhost:9250'} # do not use environments
```
```yaml
# config/elastic_map.yml
# separate environment configs
test:
host: 'localhost:9250'
prefix: 'test'
development:
host: 'localhost:9200'
```
The logger may be set explicitly:
```ruby
ElasticMap.logger = Logger.new(STDOUT)
```
See [config.rb](lib/elastic_map/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](https://rubygems.org).
## TODO
- [x] [Configrations and settings](https://github.com/adham90/elastic_map/projects/1#card-3395198)
- [ ] [Create Index base class](https://github.com/adham90/elastic_map/projects/1#card-3398857)
- [ ] [Object mapper](https://github.com/adham90/elastic_map/projects/1#card-3393856)
- [ ] [Query DSL](https://github.com/adham90/elastic_map/projects/1#card-3393917)
- [ ] [Query helpers](https://github.com/adham90/elastic_map/projects/1#card-3393926)
- [ ] [Relations](https://github.com/adham90/elastic_map/projects/1#card-3393910)
- [ ] [Embedding](https://github.com/adham90/elastic_map/projects/1#card-3393932)
- [ ] [Aggregations](https://github.com/adham90/elastic_map/projects/1#card-3395154)
- [ ] [Analyzer](https://github.com/adham90/elastic_map/projects/1#card-3395297)
## 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](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).