Having a problem getting record with intersecting ('and') condition. I have a doc:
{
"uuid": "1e2a0c06-af24-42e1-a31a-0f84233521de",
"subject": "subj",
"relations": [
{
"userUuid": "0f38e576-6b1f-4c1a-86a8-67a55a06d504",
"signed": false
},
{
"userUuid": "15979293-6b04-41a9-a6aa-bba99499496f",
"signed": true
}
]
}
Querying and expecting to get EMPTY result, cause conditions are met from different nested elements:
"bool": {
"must": [
{
"nested": {
"query": {
"term": {
"relations.userUuid": {
"value": "15979293-6b04-41a9-a6aa-bba99499496f",
"boost": 1.0
}
}
},
"path": "relations",
"ignore_unmapped": false,
"score_mode": "none",
"boost": 1.0
}
},
{
"nested": {
"query": {
"term": {
"relations.signed": {
"value": false,
"boost": 1.0
}
}
},
"path": "relations",
"ignore_unmapped": false,
"score_mode": "none",
"boost": 1.0
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
}
How to query that condition would be 'AND' within same nested object?