This application is an example of integrating the Elasticsearch search engine with the Ruby On Rails web framework.
It has been generated by application templates available at github.com/elasticsearch/elasticsearch-rails/tree/master/elasticsearch-rails/lib/rails/templates.
The ‘basic` version provides a simple integration for a simple Rails model, `Article`, showing how to include the search engine support in your model, automatically index changes to records, and use a form to perform simple search require ’requests.‘
The ‘pretty` template builds on the `basic` version and brings couple of improvements:
-
Using the [Bootstrap](getbootstrap.com) framework to enhance the visual style of the application
-
Using an ‘Article.search` class method to customize the default search definition
-
Highlighting matching phrases in search results
-
Paginating results with Kaminari
The ‘expert` template changes to a complex database schema with model relationships: article belongs to a category, has many authors and comments.
-
The Elasticsearch integration is refactored into the ‘Searchable` concern
-
A complex mapping for the index is defined
-
A custom serialization is defined in ‘Article#as_indexed_json`
-
The ‘search` method is amended with facets and suggestions
-
A [Sidekiq](sidekiq.org) worker for handling index updates in background is added
-
A custom ‘SearchController` with associated view is added
-
A Rails initializer is added to customize the Elasticsearch client configuration
-
Seed script and example data from New York Times is added