Hello,
Given a couple<key,value>
I want to create a query to find documents where a nested field contains the couple <key,value>
.
The structure is like this:
"f1":{
"key":"K1",
"value","V1"},
"f2":{
"key":"K2",
"value","V2"},
"f3":{
"key":"K3",
"value","V3"}
I've created this query for this couple <Key1,Value1>
:
GET myIndex/environment/_search
{
"query": {
"nested": {
"path" : "f1",
"query": {
"bool": {
"must": [{
"match": {
"f1.key": "Key1"
}
},
{"match": {
"f1.value": "Value1"
}
}]
}
}
}
}
}
It searches only in f1, I want to khnow if f1 or f2 or f3 contains that couple in one query.
Thanks fo help.