Skip to main content

Deploy-Searchkick-index-changes

There are tipically three cases for which Searchkick might be involved in the deployment flow:

  1. A model's #search_data method has been updated -> See Reindex
  2. A model's .searchkick method has been replaced with the .searchkick_with_next_index_settings method -> See Create next index
  3. A model's .searchkick_with_next_index_settings method has been replaced with the .searchkick method -> See Reindex

Reindex​

When a model's #search_data method gets updated the OpenSearch index data has to be reindexed to reflect those changes. Additionally a model has to be reindexed when it had been created during the last deployment, so basically when a model's .searchkick_with_next_index_settings method has been replaced with the .searchkick method, to sync it with the updates occurred since the last deployment. After the deployment, follow these steps:

  1. Visit https://active-admin.twpro.example/maintenance_tasks/tasks/Maintenance::SearchkickUtils::Reindex
  2. Fill the model_name_as_string field with the model's name and submit the form
  3. Monitor the operation

Create next index​

When a model's .searchkick method has been replaced with the .searchkick_with_next_index_settings method, follow these steps:

  1. Visit http://active-admin.twpro.example/maintenance_tasks/tasks/Maintenance::SearchkickUtils::CreateNextIndex
  2. Fill the model_name_as_string field with the model's name and submit the form
  3. Monitor the operation