Skip to content

feat: forward SearchIteratorV2 cursor across pages - #645

Open
jamesgao-jpg wants to merge 1 commit into
milvus-io:masterfrom
jamesgao-jpg:feat/search-iterator-v2-cursor
Open

jamesgao-jpg wants to merge 1 commit into
milvus-io:masterfrom
jamesgao-jpg:feat/search-iterator-v2-cursor

Conversation

@jamesgao-jpg

Copy link
Copy Markdown

Bump PROTO_COMMIT in cmake/MilvusProtoGen.cmake to a752bd706b7bf9e2ea7d930d1dff34aa95696ba6 (from milvus-io/milvus-proto#703) and forward SearchIteratorV2Results.cursor() via search_iter_cursor on every SearchIteratorV2Impl page while keeping search_iter_id (token()) unchanged.

Context

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>
@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jamesgao-jpg
To complete the pull request process, please assign arkaprabhachakraborty after the PR has been reviewed.
You can assign the PR to them by writing /assign @arkaprabhachakraborty in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot

Copy link
Copy Markdown

Welcome @jamesgao-jpg! It looks like this is your first PR to milvus-io/milvus-sdk-cpp 🎉

@mergify

mergify Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

}

auto params = request->search_params();
std::string expected_cursor = (!v1 && page_idx > 0) ? ("cursor-" + std::to_string(page_idx)) : "";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test/it/v1/TestSearchIterator.cpp line:91
High ---- The mock returns cursor "cursor-<page_idx>", but SearchIteratorV2Impl::next() only echoes the cursor from the PREVIOUS response into the next request. On the second real page (page_idx=1) the request carries "cursor-0" while expected_cursor is "cursor-1", so this EXPECT_EQ fails and testing-it will fail once the "Build and test" CI run is approved. Use "cursor-" + std::to_string(page_idx - 1) (for page_idx > 0) so the assertion matches the previous page's cursor that the iterator actually forwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants