-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Nested bool query with must #162
Labels
Comments
bodybuilder()
.query('bool', b => b.orQuery('match', 'title', 'Solr').orQuery('match', 'title', 'Elasticsearch'))
.query('match', 'authors', 'clinton gormely')
.notQuery('match', 'authors', 'radu gheorge').build() => {
"query": {
"bool": {
"must": [
{
"bool": {
"query": {
"bool": {
"should": [
{
"match": {
"title": "Solr"
}
},
{
"match": {
"title": "Elasticsearch"
}
}
]
}
}
}
},
{
"match": {
"authors": "clinton gormely"
}
}
],
"must_not": [
{
"match": {
"authors": "radu gheorge"
}
}
]
}
}
} Definitely seems like a bug |
Agree it's a bug and likely a duplicate of #142 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a really difficult time trying to build this type of query
Because when constructing the nested
bool
with ashould
inside, the library puts an extraquery
key there. So the output of thisis
Which is not a valid query. But changing the query to a filter works fine:
with the following output
Is this a bug or am I just missing something?
Thanks
The text was updated successfully, but these errors were encountered: