-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
None
-
None
-
None
-
None
-
None
-
None
-
None
There are multiple independent dimensions / combinations of running a $rankFusion on view that we need tests for. The identified dimensions are:
- The first input pipeline does or does not have a search stage
- Some or all of the input pipelines other than the first one do or do not have a search stage
- The entire $rankFusion query running on a view is or is not running inside a $lookup/$unionWith
The significance / distinction of the first pipeline vs. the other pipelines having a search stage or not has to do with how $rankFusion desugars into other stages: that is, the first pipeline is not wrapped in a $unionWith, but all the others are. This has important implications with the interactions with how a search pipeline generally runs on a view. If an aggregation pipeline on a view starts with a search stage, some special reordering / search desugaring of the stages occurs to produce a correct result (so note its possible to have an aggregation running on a view to have search stages that are not the first stage, if those search stages are wrapped in a $unionWith - which is the case in $rankFusion if the first input pipeline is not a search, but others are).
These 3 dimensions are independent and we want to test all possible combinations (2^3 = 8, or 16 if we count $lookup and $unionWith differently - but we don't need all 16 combos). Its possible, and likely, that by the time we get to this ticket some combos have already been tested, but when this ticket is complete, we should have all of these combinations working.
Also, make sure to add tests with nested view definitions. That is; views that are defined in terms of other views. There is nothing specific to $rankFusion that should interact with this, but we should make sure this works.
Also, test queries like:
db.view.aggregate([{$unionWith: { from: "coll", pipeline: [{$rankFusion}] }}])
Also, make sure all of these tests work in a single node and sharded environment.
We should write both unit tests that confirm our $rankFusion stage is desugared correctly, and js / end-to-end tests that confirm that we get correct query results.
- depends on
-
SERVER-103281 Enable and test running $rankFusion on a view with non-search input pipelines
-
- In Progress
-