-
Notifications
You must be signed in to change notification settings - Fork 83
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
Conversation
Signed-off-by: Buqian Zheng <[email protected]>
[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 |
python/knowhere/knowhere.i
Outdated
@@ -113,6 +115,25 @@ public: | |||
PyThreadState* save; | |||
}; | |||
|
|||
class AnnIterator { |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to "GetIterator"
There was a problem hiding this comment.
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.
Signed-off-by: Buqian Zheng <[email protected]>
@@ -113,6 +115,25 @@ public: | |||
PyThreadState* save; | |||
}; | |||
|
|||
class AnnIteratorWrap { | |||
public: | |||
AnnIteratorWrap(std::shared_ptr<IndexNode::iterator> it = nullptr) : it_(it) { |
There was a problem hiding this comment.
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
Signed-off-by: Buqian Zheng <[email protected]>
338f3f5
to
5352241
Compare
/lgtm |
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]>
Add GetAnnIterator method to the swigknowhere IndexWrap class to wrap the AnnIterator method, so iterator can also be used in pyknowhere.
/kind improvement