[SERVER-81046] add requireSequenceTokens to SearchCommand.CursorOptions Created: 13/Sep/23  Updated: 28/Nov/23  Resolved: 11/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0, 7.0.5, 6.0.13

Type: Task Priority: Major - P3
Reporter: Maddie Zechar Assignee: Maddie Zechar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.1, v7.0, v6.0
Sprint: QI 2023-10-02, QI 2023-10-16
Participants:

 Description   

An atlas search customer indicates that they want to paginate results by including the searchSequenceToken field in a $project stage following a $search query. For example: 

 

db.collection.aggregate([
{$search:  { text: {path: "foo", query: "test"}},
{$project: { "myToken" : { $meta : "searchSequenceToken"}},
{$limit: 2}
])
 

 

As the sequence/pagination token is requested outside of the $search query, mongod has to propagate this information to mongot. It will do so by adding `requireSequenceTokens` field to SearchCommand.CursorOptions and marking it as true when it appears in a $project stage following a $search query.



 Comments   
Comment by Githook User [ 28/Nov/23 ]

Author:

{'name': 'madelinezec', 'email': 'mez2113@columbia.edu', 'username': 'madelinezec'}

Message: SERVER-81046 create $searchSequenceToken meta expression and add requireSequenceTokens to SearchCommand.CursorOptions to enable pagination of $search queries
Branch: v6.0
https://github.com/mongodb/mongo/commit/3ad58944f7aacc54461e9a813069def15e6979df

Comment by Githook User [ 21/Nov/23 ]

Author:

{'name': 'madelinezec', 'email': 'mez2113@columbia.edu', 'username': 'madelinezec'}

Message: SERVER-81046 enable $search pagination on classic engine
Branch: v7.0
https://github.com/mongodb/mongo/commit/6844c977d4480ca476fcef62fa007e4f9a009e57

Comment by Githook User [ 11/Oct/23 ]

Author:

{'name': 'madelinezec', 'email': 'mez2113@columbia.edu', 'username': 'madelinezec'}

Message: SERVER-81046 create $searchSequenceToken meta expression and add requireSequenceTokens to SearchCommand.CursorOptions to enable pagination of $search queries
Branch: master
https://github.com/mongodb/mongo/commit/5a9af5171193924c273545536aa911049a171546

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