Skip to content

Commit

Permalink
add ordering to reindex surrogate id fetch (#4686)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelweave authored Oct 17, 2024
1 parent ce1a382 commit eb645fa
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,10 @@ protected async override Task<SearchResult> SearchForReindexInternalAsync(Search
do
{
// Get surrogate ID ranges
ranges = await GetSurrogateIdRanges(resourceType, queryStartId, globalEndId, searchOptions.MaxItemCount, 50, true, cancellationToken);
ranges = await GetSurrogateIdRanges(resourceType, queryStartId, globalEndId, searchOptions.MaxItemCount, 10, true, cancellationToken);

// Order the ranges by start id as they come back unordered. This ensures records aren't skipped during reindex.
ranges = ranges.OrderBy(x => x.StartId).ToList();

foreach (var range in ranges)
{
Expand Down

0 comments on commit eb645fa

Please sign in to comment.