8beaba
Last Updated: September 27, 2016
·
1.342K
· amirtcheva
Dd1ca1288610b1750af31b0f22a51d6c

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
Say Thanks
Respond

2 Responses
Add your response

16456
5c98d92c88d8d82a89c8b39e2477187f

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 ·