-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Remove filter parsers. #10985
Remove filter parsers. #10985
Conversation
For the record, the main challenges here were to deal with filters that behave differently from their equivalent query:
The query DSL is backward compatible, existing queries should keep working. Actually, it even allows to eg. use the Regarding documentation, I moved query definitions right under |
The diff is very large due to the fact that we have a lot of code that manipulates queries/filters but not very interesting on average, it might be easier to just ask questions. :-) |
@@ -41,6 +41,9 @@ These documents would *not* match the above filter: | |||
<2> At least one non-`null` value is required. | |||
<3> The `user` field is missing completely. | |||
|
|||
The scores produced by this query should typically not be relied upon. It is |
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.
Why the confusing warning? tf values are always 1, so in the common case it just adds some delta to every document.
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.
I removed it.
In the |
@@ -22,6 +22,9 @@ parameter. | |||
documents. | |||
|======================================================================= | |||
|
|||
If this query is used in a filter context and it has `should` clauses then at |
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.
This should be a big IMPORTANT
clause
I pushed more commits to address comments. I'm also adding the |
All good on my end, thanks for updating @jpountz . I don't have enough lucene knowledge though to review the lucene aspects here. |
…n FilterBuilders and FilterParsers" This reverts commit 580ef6f given that FilterBuilder and FilterParser are going away with #10985 Conflicts: src/main/java/org/elasticsearch/index/query/BaseFilterBuilder.java src/main/java/org/elasticsearch/index/query/BaseFilterParser.java src/main/java/org/elasticsearch/index/query/BaseFilterParserTemp.java src/main/java/org/elasticsearch/index/query/FilterWrappingFilterBuilder.java
d49a4d8
to
da66ccc
Compare
This commit makes queries and filters parsed the same way using the QueryParser abstraction. This allowed to remove duplicate code that we had for similar queries/filters such as `range`, `prefix` or `term`.
da66ccc
to
a0af88e
Compare
Query DSL: Remove filter parsers.
In elastic#10985 I introduced a bug that should clauses are parsed as filters while must_not clauses should be parsed as filters.
In elastic#10985 I introduced a bug that should clauses are parsed as filters while must_not clauses should be parsed as filters.
…n FilterBuilders and FilterParsers" This reverts commit 580ef6f given that FilterBuilder and FilterParser are going away with elastic#10985 Conflicts: src/main/java/org/elasticsearch/index/query/BaseFilterBuilder.java src/main/java/org/elasticsearch/index/query/BaseFilterParser.java src/main/java/org/elasticsearch/index/query/BaseFilterParserTemp.java src/main/java/org/elasticsearch/index/query/FilterWrappingFilterBuilder.java
This commit makes queries and filters parsed the same way using the
QueryParser abstraction. This allowed to remove duplicate code that we had
for similar queries/filters such as
range
,prefix
orterm
.