[SERVER-73204] Update mongos planning for $search pipelines to support a custom sort Created: 23/Jan/23  Updated: 29/Oct/23  Resolved: 03/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0, 6.0.6

Type: Task Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Ben Shteinfeld
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-73203 Extend $_internalSearchMongotRemote t... Closed
Problem/Incident
Related
is related to SERVER-75404 Designate $searchSortValues as metada... Closed
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Backport Requested:
v6.0
Sprint: QO 2023-02-20, QO 2023-03-06, QO 2023-03-20
Participants:
Linked BF Score: 35

 Description   

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.



 Comments   
Comment by Githook User [ 24/Mar/23 ]

Author:

{'name': 'Militsa Sotirova', 'email': 'militsa.sotirova@mongodb.com', 'username': 'militsasotirova'}

Message: SERVER-73204 Update mongos planning for $search pipelines to support a custom sort
Branch: v6.0
https://github.com/mongodb/mongo/commit/01bfc3ccba724ccec361ae1ce980785b7f3fabe1

Comment by Githook User [ 01/Mar/23 ]

Author:

{'name': 'Ben Shteinfeld', 'email': 'ben.shteinfeld@mongodb.com', 'username': 'bshteinfeld'}

Message: SERVER-73204 Allow $searchScore and $searchSortValues to be field paths
Branch: master
https://github.com/mongodb/mongo/commit/5e1bc8563cd28f41031d0713f76a1dc934eb0eff

Comment by Githook User [ 22/Feb/23 ]

Author:

{'name': 'Ben Shteinfeld', 'email': 'ben.shteinfeld@mongodb.com', 'username': 'bshteinfeld'}

Message: SERVER-73204 Designate $searchSortValues as a metadata field
Branch: master
https://github.com/mongodb/mongo/commit/51978c789c65469bb257d697b33405afe46f6d8c

Generated at Thu Feb 08 06:23:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.