Я хочу объединить must и must_not с AND в одном запросе bool. Я хочу получить те записи, чье имя Джон и нет, не должно равняться 1
пробовал ниже, но не работал
{
"query": {
"bool": {
"must": [{
"query_string": {
"query": "*alen*",
"fields": [
"name"
]
}
}],
"must_not": [{
"match": {
"no": "1"
}
}]
}
}
}
есть
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 0,
"relation": "eq"
},
"max_score": null,
"hits": []
}
}