Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iterator support to pyknowhere interface. #189

Merged
merged 3 commits into from
Nov 22, 2023

Conversation

zhengbuqian
Copy link
Collaborator

Add GetAnnIterator method to the swigknowhere IndexWrap class to wrap the AnnIterator method, so iterator can also be used in pyknowhere.

/kind improvement

@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zhengbuqian

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

The pull request process is described here

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

@@ -113,6 +115,25 @@ public:
PyThreadState* save;
};

class AnnIterator {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggest to rename to "IteratorWrap"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -157,6 +178,22 @@ class IndexWrap {
}
}

std::vector<AnnIterator>
GetAnnIterator(knowhere::DataSetPtr dataset, const std::string& json, const knowhere::BitsetView& bitset, knowhere::Status& status) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename to "GetIterator"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Keeping keyword Ann as discussed.

@@ -113,6 +115,25 @@ public:
PyThreadState* save;
};

class AnnIteratorWrap {
public:
AnnIteratorWrap(std::shared_ptr<IndexNode::iterator> it = nullptr) : it_(it) {
Copy link
Collaborator

@cydrain cydrain Nov 22, 2023

Choose a reason for hiding this comment

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

suggest to assert here if it is NULL

@cydrain
Copy link
Collaborator

cydrain commented Nov 22, 2023

/lgtm

@sre-ci-robot sre-ci-robot merged commit 2191316 into zilliztech:main Nov 22, 2023
6 checks passed
@zhengbuqian zhengbuqian deleted the pyknowhere-it branch November 22, 2023 03:06
cydrain added a commit to cydrain/knowhere that referenced this pull request Dec 5, 2023
  Correct bitset support in pyknowhere (zilliztech#165)
  Add new interface for brute force search and simd test in pyknowhere
  (zilliztech#170)
  Add iterator support to pyknowhere interface. (zilliztech#189)
  Use knowhere-test refactor (zilliztech#217)

Signed-off-by: Yudong Cai <[email protected]>
sre-ci-robot pushed a commit that referenced this pull request Dec 5, 2023
…h: (#248)

Correct bitset support in pyknowhere (#165)
  Add new interface for brute force search and simd test in pyknowhere
  (#170)
  Add iterator support to pyknowhere interface. (#189)
  Use knowhere-test refactor (#217)

Signed-off-by: Yudong Cai <[email protected]>
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