-
Notifications
You must be signed in to change notification settings - Fork 183
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
[FEATURE] Add high level DSL for k-nn plugin #300
Comments
Would you be up for creating the PR? |
Transferring this issue here as opensearch-dsl-py is being merged into opensearch-py as part of #194 |
I believe #291 is a related request. |
pinging @armenabnousi as they may be interested... I'm down to create a PR to introduce k-NN APIs into Per @arnavdas88's suggestion, I think it would make sense to incorporate k-NN via from opensearchpy import OpenSearch
client = OpenSearch(...)
my_vector = [1, 2, 3, ... 1024]
# approx k-NN
client.knn.approx(index="example", field="vector", vector=my_vector, size=10)
# exact k-NN
query = {
"query": {
"match_all": {}
}
}
client.knn.exact(index="example", body=query, field="vector", vector=my_vector, size=10) This would be a nice augmentation to existing search functionality for k-NN users. What APIs from k-NN plugin API would you like to see? Perhaps methods like |
One can do k-nn in the client today, see https://github.com/opensearch-project/opensearch-py/blob/main/guides/plugins/knn.md, renamed this issue to add a higher level DSL. |
A mechanism for plugins was added in #93. Hopefully someone can pick this one up. |
I will work on adding specifications for the knn-plugin and fine-tuning the generator for plugin generation. |
I am closing this issue since KNN APIs are now available in opensearch-py. If you feel the issue is not resolved, please feel free to reopen it. |
I can see docs at https://github.com/opensearch-project/opensearch-py/blob/main/guides/plugins/knn.md. Are there high level DSL API for k-nn plugin? |
Do you have an example of what we have vs. what you'd like to write? Maybe we should reopen this. |
This page explains High level Python API. I want to know
|
There's no higher level DSL implemented indeed. You should open a feature request for it, but that's basically my question: what would you like to write in Python that doesn't look like https://github.com/opensearch-project/opensearch-py/blob/main/samples/knn/knn_basics.py#L78. Include that in that issue. Note there are some related issues like #630 too. |
If there is a High level API, it would be natural to try that first. If the High level API does not support some features, it would be kind to describe it in the documentation. |
I agree @kenmasumitsu. Help us out by contributing? |
As the ANN plugin is out, it would be great to have an index and field for it
The text was updated successfully, but these errors were encountered: