Skip to content

Commit

Permalink
fix(AlgoliaClient): manually clear and update data instead of replace
Browse files Browse the repository at this point in the history
  • Loading branch information
bkapustik committed May 30, 2024
1 parent f9b31df commit 72b1502
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Services/Implementations/DefaultAlgoliaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ public void Rebuild(string indexName)
var dataToUpsert = new List<JObject>();
indexedNodes.ForEach(node => dataToUpsert.AddRange(GetDataToUpsert(new AlgoliaQueueItem(node, AlgoliaTaskType.CREATE, algoliaIndex.IndexName))));
var searchIndex = algoliaIndexService.InitializeIndex(algoliaIndex.IndexName);
searchIndex.ReplaceAllObjects(dataToUpsert);
searchIndex.ClearObjects();
searchIndex.SaveObjects(dataToUpsert);
}


Expand Down

0 comments on commit 72b1502

Please sign in to comment.