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

[Feature] Add efficient k-NN filtering support to Neural query #523

Closed
SeyedAlirezaFatemi opened this issue Dec 26, 2023 · 9 comments
Closed
Assignees
Labels
Documentation Update existing documentations such as README, instruction docs, etc.

Comments

@SeyedAlirezaFatemi
Copy link

Is your feature request related to a problem?

Currently, there is no way to use efficient k-NN filtering with a Neural query (documentation)

What solution would you like?

Adding a filter field to the neural query which is pretty similar to the syntax of efficient k-NN filtering:

"neural": {
  "<vector_field>": {
    "query_text": "<query_text>",
    "query_image": "<image_binary>",
    "model_id": "<model_id>",
    "k": 100,

    "filter": {
      ...
    }

  }
}
@navneet1v
Copy link
Collaborator

@SeyedAlirezaFatemi the feature is already supported with neural query clause and works exactly you have defined in the description.

The documentation is not updated to say that it is supported,

cc: @jmazanec15 @vamshin

@navneet1v navneet1v added Documentation Update existing documentations such as README, instruction docs, etc. and removed untriaged enhancement labels Dec 29, 2023
@navneet1v navneet1v moved this from Backlog to Backlog (Hot) in Vector Search RoadMap Dec 29, 2023
@SeyedAlirezaFatemi
Copy link
Author

I think the Java Client for OpenSearch also doesn't support it.

@jmazanec15
Copy link
Member

For filtering support, we do mention it here: https://opensearch.org/docs/latest/search-plugins/semantic-search/#step-4-search-the-index-using-neural-search. That being said, its not easy to find. We should have a section on the query itself and the parameters of the query.

@navneet1v
Copy link
Collaborator

I think the Java Client for OpenSearch also doesn't support it.

@SeyedAlirezaFatemi for which java client? high level java rest client or opensearch-java(low level client)?

@SeyedAlirezaFatemi
Copy link
Author

@navneet1v opensearch-java. NeuralQuery

@navneet1v
Copy link
Collaborator

navneet1v commented Dec 29, 2023

@SeyedAlirezaFatemi thanks for providing the details.

@VachaShah, @dblock: can we move this issue in opensearch-java repo. I don't have permission to transfer the issue.

cc: @vamshin , @jmazanec15

@navneet1v navneet1v changed the title [FEATURE] Add efficient k-NN filtering support to Neural query [Documentation] Add efficient k-NN filtering support to Neural query Feb 5, 2024
@navneet1v navneet1v changed the title [Documentation] Add efficient k-NN filtering support to Neural query [Feature] Add efficient k-NN filtering support to Neural query Feb 5, 2024
@rahulbhatia2702
Copy link

@navneet1v is prefiltering also available for neural sparse search ?

@navneet1v
Copy link
Collaborator

navneet1v commented Feb 22, 2024

@navneet1v is prefiltering also available for neural sparse search ?

as per my understanding the ans is no. But @zane-neo can you please provide more details.

@vamshin vamshin moved this from Backlog (Hot) to ✅ Done in Vector Search RoadMap Jul 2, 2024
@heemin32
Copy link
Collaborator

Closing the issue. Please reopen the issue in java client repo.
For sparse vector search, it works in a manner similar to text search. Therefore, the concept of pre-filtering does not apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Update existing documentations such as README, instruction docs, etc.
Projects
Status: Done
Development

No branches or pull requests

5 participants