Searchkick with Mongoid and Rails 4.0
The biggest thing here is to include searchkick after your fields:
class User
include Mongoid::Document
field :user_id, type: Integer
field :name, type: String
searchkick
Then, start the elasticsearch server:
elasticsearch start
In Rails Console:
User.reindex
Written by Alexandra Mirtcheva
Related protips
2 Responses
Thanks! :D i first tried mongoid-elasticsearch but for whatever reason it was not working ok. Finding searchkick made it work.
over 1 year ago
·
how to place search data
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#