Searchkick
suggest changeIf you want to set up Elasticsearch quickly, you can use the searchkick gem:
gem "searchkick"
Add searchkick to models you want to search.
class Product < ActiveRecord::Base
searchkick
end
Add data to the search index.
Product.reindex
And to query, use:
products = Product.search("apples")
products.each do |product|
puts product.name
end
Pretty quick; Elasticsearch knowledge is 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