-
Type:
Sub-task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Overview
Fix $lookup and $unionWith to call lowerToExecutable() on $_documentResultsAndMetadata when it appears at the front of their sub-pipelines.
Background
run_agg.cpp's prepareExecutorsForPipeline only lowers $_documentResultsAndMetadata at the top-level pipeline. $lookup and $unionWith defer sub-pipeline preparation until doGetNext() at execution time, so the top-level lowering pass never recurses into them. If $search appears inside a $unionWith or $lookup sub-pipeline, the container will sit unexpanded when the sub-pipeline first executes.
Scope of Work
In DocumentSourceLookup::doGetNext() and DocumentSourceUnionWith::doGetNext(), before the sub-pipeline is first executed, check whether its front stage is a DocumentSourceDocumentResultsAndMetadata and if so call lowerToExecutable() on it
Acceptance Criteria
- $search inside a $unionWith sub-pipeline executes correctly with scoped $$SEARCH_META
- \$search inside a $lookup sub-pipeline executes correctly
- Outer $$SEARCH_META is not affected by inner-scope lowering
- Test coverage for $search-in-$unionWith and $search-in-$lookup
- depends on
-
SERVER-126009 [M1 - Search Extension] Implement lowerToExecutable() and invoke from run_agg.cpp
-
- Closed
-