-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add support for extracting ranges from percolator queries #19191
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
Conversation
|
||
Because the `percolate` query is processing one document at a time, it doesn't support queries and filters that run | ||
against child documents such as `has_child` and `has_parent`. | ||
|
||
The percolator doesn't accepts percolator queries containing `range` queries with ranges that are based on current | ||
time. (using `now`). |
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.
maybe remove the dot after time
?
…g percolator queries. Disallow percolator queries containing `range` queries that have ranges based on current time (`now`).
7e556fd
to
934f581
Compare
range
queries during indexing percolator queries
I don't understand how the percolator can correlate the ranges of values with the name of the field. For instance if I index a query on a |
So it doesn't know and in the case of your example it the approximation query will match and then we the MemoryIndex verifies that match it will not verify it and so it will never match. The goal here is to do better for range queries than we do right now (in many cases marking the entire percolator query as failed). The should clause with range queries that we add to the approximation query will yield more false matches, then the should clause we add for evaluating the percolator queries that failed query extraction. So I think in general it will be better?
If the document has at least one range that matches (not necessarily matching with the field) with what we recorded for the percolator query at index time the approximation query will match it. Depending if the range matches with the field and if it needs to match with the other ranges too (depending if ranges are part of a conjunction or disjunction) it will be become a match after it has been verified by the MemoryIndex. So in the previous approach we did record with what field a range belongs to, so it was less likely to be a false positive. The big down side is that we didn't have control over the amount of fields the With this approach we will always have 12 fields for range queries. In retrospect I'm still not happy with the facts that we add 12 fields (it is still a lot) (field per number type) and that the approximation query is less accurate. I don't feel there is rush to get this in, there must be a better approach the handle range queries. |
Thanks for the explanation, it makes sense.
I have mixed feelings about it too. On the one hand I don't want to have one field per query field in order to index range queries, but on the other hand, using a field per field type introduces fuzziness that makes me a bit worried, both because it could be a nest for bugs, and also because there could certainly be patterns of range queries and/or documents that defeat this optimization by making queries always returned by the approximation. I think we should put it on hold for now. |
@jpountz I do want to extract the |
+1 |
Closing this PR, we should look into this optimization another time. Opened #19327 for the |
This is a follow up of #19191 for 7.x. This change adds a system property called "es.routing.search_ignore_awareness_attributes" that when set to true will effectively ignore allocation awareness attributes when routing search and get requests. This is now the default in 8.x so this commit adds a way to opt-in to this new behavior in a minor version of 7.x. Relates #45735
This is a follow up of elastic#19191 for 7.x. This change adds a system property called "es.routing.search_ignore_awareness_attributes" that when set to true will effectively ignore allocation awareness attributes when routing search and get requests. This is now the default in 8.x so this commit adds a way to opt-in to this new behavior in a minor version of 7.x. Relates elastic#45735 # Conflicts: # docs/reference/modules/cluster/allocation_awareness.asciidoc
Also stop support percolator queries containing
range
queries with ranges based onnow
.