Searchkick
suggest changeIf you want to setup quickly elasticsearch you can use the searchkick gem :
gem 'searchkick'
Add searchkick to models you want to search.
class Product < ActiveRecord::Basesearchkickend
Add data to the search index.
Product.reindex
And to query, use:
products = Product.search "apples"products.each do |product|puts product.nameend
Pretty quick, elasticsearch knowledge not required ;-)
More information here : https://github.com/ankane/searchkick
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents