-
Notifications
You must be signed in to change notification settings - Fork 0
[JAY-678] Allow nested Elasticsearch boolean queries #41
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
084376b to
999704e
Compare
sheputis
left a comment
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.
question, does this leave the 'not' behaviour consistent? it does not break anything?
documentation/source/user_guidelines/elasticsearch/query_builder.rst
Outdated
Show resolved
Hide resolved
Changes the QueryBuilder::QueryClauses::Bool class to allow it to accept nested boolean queries. The main driver behind this change is the need to combine 'must' and 'should' clauses with a particular precedence when querying multiple indexes, especially when some of the fields in the query exist in only a subset of those indexes.
Well, the negation works by wrapping whatever you currently have into a But that is probably beyond the scope of Jay API. I.e. it cannot be stuffed with extra logic to fix the inconsistencies of Elasticsearch (if there are actually any). |
999704e to
4f9445b
Compare
Ah, just to clarify — I didn’t mean for you to verify Elasticsearch’s behavior :) I always forget the exact details of how the query builder is structured (it’s a bit complex), and I remember we’ve had regressions in the not handling before. So my question was just to double-check whether you had that in mind when making the change. |
No worries. I appreciate you raising the question. I actually went into the code to check what was actually happening. It did not occur to me that the negation could break. So thanks for bringing that up. 🤝 |
Changes the
QueryBuilder::QueryClauses::Boolclass to allow it to accept nested boolean queries.The main driver behind this change is the need to combine
mustandshouldclauses with a particular precedence when querying multiple indexes, especially when some of the fields in the query exist in only a subset of those indexes.