Hello,
I have two documents:
POST query_test/_doc
{
"field": [
{
"field1": "Pam",
"field2": "Beesly"
},
{
"field1": "Jim",
"field2": "Halpert"
}
]
}
POST query_test/_doc
{
"field": [
{
"field1": "Pam",
"field2": "Halpert"
},
{
"field1": "Jim",
"field2": "Halpert"
}
]
}
How to query that index, to return only second document with Pam Halpert?
Below query returns both documents:
GET query_test/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"field.field1": "Pam"
}
},
{
"match": {
"field.field2": "Halpert"
}
}
]
}
}
}