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 committed Oct 21, 2024
1 parent e273b68 commit ac14c20
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 ac14c20

Please # to comment.