Searchkick reindex on heroku

I keep getting this error when I deploy to heroku:

 Searchkick::MissingIndexError in PostsController#search
Index missing - run Post.reindex

      

It works in development, but how do I get re-indexed in production? Please provide the exact steps as needed.

Here is my controller for the link:

def search
    @posts = Post.search(params[:search])
end

      

+3


source to share


1 answer


Ok, I figured out that people are struggling with this run:

heroku run rake searchkick:reindex CLASS=PutYourClassHere

      



then

heroku run rake db:migrate

      

+13


source







All Articles