when replacing all objects, a temporary index is used to store new data, and once ready it
replace the original index.
There was an issue when replace_all_objects was called with 'safe' move:
when copying the existing index, and only replacing the index name, the
name of _search_index (from SearchIndexAsync constructor) was not replaced
with the temporary index name (tmp_index_name)
after that, when tracking the task progress in IndexingResponse.wait the original
index name from _search_index was used instead of the tmp_index_name
What problem is this fixing?
Although it was working before, when tracked using the wrong index name,
the indexing task is stuck with status notPublished. (maybe it's something that should
also be fixed on the backend ?)
With this patch, instead of trying to patch SearchIndex copied instance, we create a
new clean instance.
When updating a "dev" index, previous call history would be:
Describe your change
create new SearchIndex instance when creating a temporary index in replace_all_objects
as per doc: https://www.algolia.com/doc/api-reference/api-methods/replace-all-objects/,
when replacing all objects, a temporary index is used to store new data, and once ready it replace the original index.
There was an issue when
replace_all_objects
was called with 'safe' move:_search_index
(from SearchIndexAsync constructor) was not replaced with the temporary index name (tmp_index_name
)IndexingResponse.wait
the original index name from_search_index
was used instead of thetmp_index_name
What problem is this fixing?
Although it was working before, when tracked using the wrong index name, the indexing task is stuck with status
notPublished
. (maybe it's something that should also be fixed on the backend ?)With this patch, instead of trying to patch
SearchIndex
copied instance, we create a new clean instance.When updating a "dev" index, previous call history would be:
after the fix the task is tracked on the correct index: