8beaba
Last Updated: September 27, 2016
·
1.486K
· 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

16456

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

how to place search data

over 1 year ago ·