-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
We should be able to support queries like:
db.coll.aggregate([{$unionWith/$lookup: { from: "view", pipeline: [{$rank/scoreFusion}] }}])
After this ticket is complete, which is currently disallowed.
Watch out for differences in input pipelines that do an do not have $search stages, as as a $search on a view (inside a $unionWith as well) as its own complexities that non-search pipelines on a view does not.
This PR adds support for search stages on a view inside a $unionWith.
Similarly to the complexity of running $rankFusion on a view with or without search input pipelines at a top-level aggregation pipeline, we have the same complexity to consider inside of a $unionWith; as a $unionWith essentially runs its own independent query internally inside of a its document source.
Note that DocumentSourceUnionWith has its own internal _pipeline that will hold the desugared stages of $rankFusion; and this needs to play nice with whatever pipeline transformation is done to support search stages on a view inside of $unionWith.
This PR was also originally introduced to support search inside of $unionWith (but was disabled and does not support sharding)