Last Updated: September 27, 2016
·
2.075K
· amirtcheva

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

2 Responses
Add your response

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 ·