Rough sequence of events:
1. mongos receives $search query
2. mongos send planShardedSearch to mongot and receives a custom sort spec
3. mongos builds shards pipeline with $_internalSearchMongotRemote stage, passing the custom sort
4. mongos builds merging pipeline with $mergeCursors, also passing the custom sort
The assumption is that each shard will continue to populate the $sortKey as it does today, so the ARM/$mergeCursors should not need to be updated to support this but we should build it (step #4) with the correct spec for explain purposes.
- is duplicated by
-
SERVER-73203 Extend $_internalSearchMongotRemote to accept a custom sort spec
- Closed
- is related to
-
SERVER-75404 Designate $searchSortValues as metadata field on v5.0
- Closed