-
Notifications
You must be signed in to change notification settings - Fork 1.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
[BUG] Discrepancy in result from _validate/query API and actual query validity #2036
Comments
@MarinaRazumovsky let me know if there is anything I should add here to the bug you found |
@AmiStrn started to look at it, have difficulties in reproducing the issue, could you please share |
Thanks for looking into this. I will validate if this is only on a specific type of mapping. |
@reta I tested again and found that this is indeed a bug:
|
Oh @AmiStrn , I now understand the problem clearly: the problem is not range query, the problem is referencing non-existing property in range query, which is
If you replace
Will try to find out what is going on here |
Maybe it happens also with dates? We discovered this using a valid field (our timestamp field). I will check again using same setup. |
@AmiStrn I have even more details for you: the validation is subject to what is stored in the index (I didn't know that!), at least for date fields there is an optimization which basically says if the index contains any document with the property value in required range or not. If none - the query is rewritten as |
Describe the bug
When validating a query using the _validate, and the query has both: allow_leading_wildcard =
false
AND a range filter in the boolean query - the result is valid - even if there is a leading wildcard present in the query.To Reproduce
Steps to reproduce the behavior:
url:
localhost:9200/my-index/_validate/query
body:
response:
*** Notice
"valid": true
while the query has"allow_leading_wildcard": false
explicitly2. now send this query body removing the range filter only:
response:
Notice this time the response is as expected
"valid": false
3. the original query with the time range filter fails when attempting to send it after the mistake in the validation:
Expected behavior
Range filter should not affect the validation of the query if we failed on the wildcard! should return
"valid": false
in both cases.Host/Environment (please complete the following information):
Additional context
Seems to be a bug dating back to Elasticsearch 6.8 at least
The text was updated successfully, but these errors were encountered: