-
Notifications
You must be signed in to change notification settings - Fork 144
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
[BUG] Explain API not compatible with k-NN queries #875
Comments
@SeyedAlirezaFatemi could you please let us know what you are looking in the explain api? |
[Feature]: Support Explain API for KNNOverviewThe explain API in OpenSearch is helpful to the customers to figure out how the relevance score is calculated for every result returned by a query.
Use-cases where explain API is helpful:
KNN supports different types of searches like approximate nearest neighbor search, exact search, disk-based search, radial search, etc. There are various factors taken into consideration to execute a type of search based on the query given by the customer. Customers find it difficult to understand why a particular type of search was executed for KNN and would benefit with a support of explain API for the KNN queries. Current State
Github issues seeking feature support Feature aim Scope for the proposal
Proposed User ExperienceExplanation into two layers First layer would tell whether the type of KNN search was Approximate NN or Disk-based or Radial.
Alternatives considered
Release Plan for different phases
Future improvements
|
Proposed output for different KNN searches with explain
|
I will next be raising a PR for the explain API changes. |
Hello, can we also include naming the the knn query, this way we can have scores matched to the query itself Like below
and if we can attach the cosine similarity score for each hit that matched this vector |
@Dharin-shah This is a different requirement, the scope of this issue is limited to explain api, please open a new feature request for this, thanks.
|
What is the bug?
The Explain API is not compatible with k-NN queries and assumes they have a score of 1. Well, I don't think there is a useful explanation to be given for k-NN queries, but when you have multiple k-NN queries or k-NN queries combined with text match queries, knowing the score of each k-NN part individually can be helpful.
How can one reproduce the bug?
Just make a k-NN query and set the
explain
flag totrue
.What is the expected behavior?
Just have the score of the k-NN part correctly as the
value
field in the explanation.Do you have any screenshots?

The text was updated successfully, but these errors were encountered: