-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…97500) The FetchPhase sets source and field providers on its SearchLookup instance to ensure that we only have to load stored fields once per document. However, these were being set after subprocessors were constructed, and the FetchFieldsPhase subprocessor pulls a reference to the SearchLookup at construction time. This meant that the FieldsFetcher was not using these providers, instead using the standard source and fields lookup, in effect meaning that fields access would load source and fields separately. This would mostly just be an issue with performance; however, the top hits aggregation calls the fetch phase multiple times, with the result that the second and subsequent buckets in a top hits aggregation would see the source lookup from the previous bucket when building their FetchFieldsPhase subprocessor. This commit moves the call to SearchExecutionContext#setLookupProviders() in FetchPhase#buildSearchHits() before the call to build fetch phase subprocessors, ensuring that the fetch fields phase sees the correct SearchLookup. Fixes #96284
- Loading branch information
1 parent
3414aa7
commit c14fdf6
Showing
3 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 97460 | ||
summary: Set new providers before building `FetchSubPhaseProcessors` | ||
area: "Search" | ||
type: bug | ||
issues: | ||
- 96284 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters