Giter VIP home page Giter VIP logo

es-searchapp's Introduction

Ruby on Rails and Elasticsearch: Example application

This application is an example of integrating the {Elasticsearch}[http://www.elasticsearch.org] search engine with the {Ruby On Rails}[http://rubyonrails.org] web framework.

It has been generated by application templates available at https://github.com/elasticsearch/elasticsearch-rails/tree/master/elasticsearch-rails/lib/rails/templates.

[1] Basic

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

[2] Pretty

The pretty template builds on the basic version and brings couple of improvements:

  • Using the Bootstrap 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

[3] Expert

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

[4] DSL

The dsl template refactors the search definition in SearchController#index to use the elasticsearch-dsl Rubygem for better expresivity and readability of the code.

[5] Settings Files

The settings-files template refactors the Searchable module to load the index settings from an external file.

es-searchapp's People

Watchers

Antonette Caldwell avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.