Hello,
I am trying to do a query with two conditions within the "must" part of a "bool" query. Each condition is a nested query. The query is as follows:
{
"query":{
"bool":{
"filter":[
{
"nested":{
"path":"attributes",
"query":{
"bool":{
"must":[
{
"match":{
"attributes.key":"ATT001"
}
}
]
}
}
}
},
{
"nested":{
"path":"attributes.details",
"query":{
"bool":{
"must":[
{
"match":{
"attributes.details.locales":"en-GB"
}
}
]
}
}
}
}
]
}
}
}
The result of my query is as follows (some data snipped out):
{
"hits":{
"total":{
"value":1,
"relation":"eq"
},
"max_score":0,
"hits":[
{
"_source":{
"attributes":[
{
"key":"ATT001",
"details":[
{
"locales":[
"de-DE"
]
}
]
}
]
}
}
]
}
}
I would expect not having this item in my result, as I think the query is literally a "attributes.key = 'ATT001' AND attributes.details.locales = 'en-GB'"