If I have a flattened or object field named X, which is an array of objects with subfields A and B, how can I query for an item that has specific values for both A and B?
E.g. if I run the following:
{
"query": {
"bool": {
"must": [
{
"term": {
"X.A": "v1"
}
},
{
"term": {
"X.B": "v2"
}
}
]
}
}
}
It'll include hits like the following hit which I don't want:
{"x": [
{
"A": "v1",
"B": "v0",
},
{
"A": "v0",
"B": "v2",
}
]}
I only want hits like:
{"X": [
{
"A": "v1",
"B": "v2"
}
]}