Deploy-Searchkick-index-changes
There are tipically three cases for which Searchkick might be involved in the deployment flow:
- A model's
#search_datamethod has been updated -> See Reindex - A model's
.searchkickmethod has been replaced with the.searchkick_with_next_index_settingsmethod -> See Create next index - A model's
.searchkick_with_next_index_settingsmethod has been replaced with the.searchkickmethod -> 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:
- Visit https://active-admin.twpro.example/maintenance_tasks/tasks/Maintenance::SearchkickUtils::Reindex
- Fill the
model_name_as_stringfield with the model's name and submit the form - 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:
- Visit http://active-admin.twpro.example/maintenance_tasks/tasks/Maintenance::SearchkickUtils::CreateNextIndex
- Fill the
model_name_as_stringfield with the model's name and submit the form - Monitor the operation