-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Validate API fails when validating Terms query #29033
Comments
Pinging @elastic/es-search-aggs |
Some notes: I reproduced this issue on Looking at the TermsQueryBuilder class itself, the It seems like these async actions would get executed via Interested if anyone from search-aggs has any idea, based on the above, what the problem might be rooted from? I'm not sure if |
I think the problem here is down to us only calling one of the two rewrite phases for the QueryBuilder in the Validate Query API. There are two rewrites phases that happen on the search API:
The first rewrite phase is called when we execute a search request in |
So it's seeming like So, I think the code that's causing the issue here is
So it seems like what's happening is:
If the above is accurate, what's the best strategy to fix this? Seems like we could either Update Rewritable to block on async tasks, update TermsQueryBuilder.doRewrite not to use async tasks, or something similar? Only a couple of the QueryBuilders add async actions to the context, GeoShape query and Percolate query builders. Interestingly, |
@pcsanwald I took a look at this and applied your changes locally. The code is actually doing almost everything right in that its correctly registering the async action and then executing it when it runs |
Elasticsearch version: 6.2.2
Plugins installed: -
JVM version: 1.8.0_161
OS version : docker image
Description of the problem including expected versus actual behavior:
The validate API is failing when attempting to validate a valid terms query. The following error message is shown:
Steps to reproduce:
Provide logs (if relevant):
Response from the validate API:
The text was updated successfully, but these errors were encountered: