Elasticsearch provides a powerful, RESTful HTTP interface for indexing and querying data, built on top of the Apache Lucene library. it provides scalable, efficient, and robust search, with UTF-8 support. It’s a powerful tool for indexing and querying massive amounts of structured data.
Despite Elasticsearch’s scalability and efficiency, integrate it with Rails didn’t end up being quite as straightforward as anticipated. And thus, the Chewy gem was born.
A few notably noteworthy options of Chewy include:
Most indexed models square measure associated with one another. And generally, it’s necessary to denormalize this connected information and bind it to a similar object (e.g., if you wish to index an associate degree array of tags beside their associated article). Chewy permits you to specify associate degree updatable index for each model, thus corresponding articles are going to be re-indexed whenever a relevant tag is updated.
With this improvement, implementing cross-model auto-completion, as an example, is far easier. you'll simply outline the associate degree index and work with it in an object-oriented fashion. not like alternative shoppers, the Chewy gem removes the requirement to manually implement index categories, information import callbacks, and alternative elements.
3. Bulk import is everywhere:
Chewy utilizes the majority Elasticsearch API for full re-indexing and index updates. It additionally utilizes the conception of atomic updates, aggregation modified objects among associate degree atomic block and change all of them right away.
4. Chewy provides associate degree AR-style question DSL.
By being chainable, mergeable, and lazy, this improvement permits queries to be created in a very additional economical manner.