-
-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Labels
Description
I am curious if it is possible with this module to set up a complex elastic query that has should queries nested within a must.
Simply, I am trying to recreate this SQL query:
SELECT * FROM test where status = 'active' and (city = 'New York' or city = 'Toronto')
I would like to get back something similar to the below, but I have only been able to have the MUST and the SHOULD on the same level. Is this functionality possible? It seems like a simple query case, but maybe I am wrong.
{
"query": {
"bool": {
"must": {
"bool": {
"must": [
{
"match": {
"status": {
"query": "active"
}
}
},
{
"bool": {
"should": [
{
"match": {
"city": {
"query": "New York"
}
}
},
{
"match": {
"city": {
"query": "Toronto"
}
}
}
]
}
}
]
}
}
}
}
}
joeltello, danieleorler, diegoprd and sarthi2395