Answer the question
In order to leave comments, you need to log in
How to check if a field exists in a document with an AND operator?
There is a normal search, where we search by `category_id` and the existence of the `fields.id` characteristic
"query" => [
"bool" => [
"must" => [
"match" => [
"category_id" => $category_id
], [
"exists" => [
"field" => "fields.$id"
]
]
]
]
]
"match" => [
"message" => [
"query": "this is a test",
"operator": "or"
]
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question