-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Have top level knn searches tracked in query stats #132548
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
Have top level knn searches tracked in query stats #132548
Conversation
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Hi @benwtrent, I've created a changelog YAML for you. |
…rent/elasticsearch into bugfix/knn-account-for-query-stats
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.
The change LGTM 👍
A query with both knn section and a query will have multiple onPreQueryPhase / onQueryPhase calls. I wonder if we should have a different listener method for it, so we can tell apart the knn section from other queries?
@carlosdelest I went and checked the logic for the
It looks like (for knn) it would only call However, I did notice that if there was a failure, we might not actually decrement this correctly as we don't catch and then call I will add a try/finally here to make sure we decrement. |
Looks good! 👍 |
Sorry for waking this up, I see this is labeled 9.2.0, is this or will fix this be added to a minor fix of the 8.x major version? Or do we need to upgrade to 9 to get this fix? |
Since dfs kNN searches aren't in the query phase, we don't get their search stats for free in query stats.
This adds their stats specifically during knn search in dfs.
closes: #128098