The draft in SERVER-92213 uses the trick with $group and $push to compute the rank of documents, but we believe it will be better to go with a version that uses $setWindowFields and $rank to compute the same thing, for performance reasons, and so that it doesn't error when given too much data.
You can sort by {key: {$meta: "sortKey"}}
- depends on
-
SERVER-91281 Allow $rank and $denseRank window functions to operate without a SortKeyPattern
- Closed
-
SERVER-92213 Implement desugaring of $rankFusion
- Closed
-
SERVER-96064 Optimize away $sort directly after $vectorSearch for single node environments
- Closed
-
SERVER-94628 Ensure we do not do a redundant $sort by search score during $rankFusion.
- Closed
- is related to
-
SERVER-99695 Support for $sample in $rankFusion
- Blocked