ruby-on-railsrubyelasticsearchsearchkick

Reindex only a single Model from the command line in SearchKick


I am stuck trying to reindex a single model in SearchKick.

If I run the following command:

rails Profile.reindex

I get the following error:

Profile.reindex: command not found

I am able to run the command

rails searchkick:reindex:all

but that takes over an hour because of the size of my other models.

Any help would be appreciated.

Thanks,

Gerard


Solution

  • You can re-index just the Profile class using

    rails searchkick:reindex CLASS=Profile
    

    If you just run

    rails searchkick:reindex
    

    It will provide the USAGE explanation

    Example buried in the Docs

    Explanation in the Source Code: Searchkick rake tasks