Have top level knn searches tracked in query stats#132548
Have top level knn searches tracked in query stats#132548elasticsearchmachine merged 6 commits intoelastic:mainfrom
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
carlosdelest
left a comment
There was a problem hiding this comment.
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