Skip to content

Commit 91bafe1

Browse files
javannacbuescher
authored andcommitted
Clarify comment in SearchExecutionContext#setLookupProviders (elastic#112487)
Remove a TODO around asserting that setLookupProviders is only called as part of the fetch phase. That is not the case, hence we are not going to address that, but it makes sense to replace the TODO with a comment that clarifies how the method may be used and called.
1 parent 1d0064a commit 91bafe1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/elasticsearch/index/query/SearchExecutionContext.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ public void setLookupProviders(
511511
SourceProvider sourceProvider,
512512
Function<LeafReaderContext, LeafFieldLookupProvider> fieldLookupProvider
513513
) {
514-
// TODO can we assert that this is only called during FetchPhase?
514+
// This isn't called only during fetch phase: there's scenarios where fetch phase is executed as part of the query phase,
515+
// as well as runtime fields loaded from _source that do need a source provider as part of executing the query
515516
this.lookup = new SearchLookup(
516517
this::getFieldType,
517518
(fieldType, searchLookup, fielddataOperation) -> indexFieldDataLookup.apply(

0 commit comments

Comments
 (0)