-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Allowing range queries with now ranges inside percolator queries #23921
Allowing range queries with now ranges inside percolator queries #23921
Conversation
Using instance equality is a bit dangerous since the query could still get cached if you run the same query instance multiple times. I think this is an ok risk given that we create new queries everytime, but I think we should have comments about it in the equals/hashCode methods. |
@jpountz Agreed. Added the comments. I basically looked at ScriptQuery and saw that we compare it in the same way also to avoid caching. |
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.
LGTM
… queries. Before now ranges where forbidden, because the percolator query itself could get cached and then the percolator queries with now ranges that should no longer match, incorrectly will continue to match. By disabling caching when the `percolator` is being used, the percolator can now correctly support range queries with now based ranges. I think this is the right tradeoff. The percolator query is likely to not be the same between search requests and disabling range queries with now ranges really disabled people using the percolator for their use cases. Also fixed an issue that existed in the percolator fieldmapper, it was unable to find forbidden queries inside `dismax` queries. Closes elastic#23859
7507a4a
to
3d9671a
Compare
@martijnvg I'm wondering if I should be able to use ranges after this commit, but I'm still getting an IllegalArgumentException https://discuss.elastic.co/t/allowing-range-queries-with-now-ranges-inside-percolator/85696 Any idea what else do I have to do? |
Range queries with now based date ranges were previously not allowed, but since elastic#23921 these queries were allowed. This change should really fix range queries with now based date ranges.
Range queries with now based date ranges were previously not allowed, but since #23921 these queries were allowed. This change should really fix range queries with now based date ranges.
Range queries with now based date ranges were previously not allowed, but since #23921 these queries were allowed. This change should really fix range queries with now based date ranges.
Before now ranges where forbidden, because the percolator query itself could get cached and then the percolator queries with now ranges that should no longer match, incorrectly will continue to match.
By disabling caching when the
percolator
is being used, the percolator can now correctly support range queries with now based ranges.I think this is the right tradeoff. The percolator query is likely to not be the same between search requests and disabling range queries with now ranges really disabled people using the percolator for some of their use cases.
Also fixed an issue that existed in the percolator fieldmapper, it was unable to find forbidden queries inside
dismax
queries.PR for #23859