My intention is to find a word in all documents which have this condions:
("type" => "Faq") OR ("type" => "NormativeDoc") OR ("type" => "Document" AND "profile_id_document" => X).
I tried this but it doesn't work:
$params = [
'index' => global_index,
'type' => 'documento_globale',
'body' => [
'query' => [
'bool' => [
'must' => [
'query_string' => [
'query' => "{$keyword}"
]
],
"should" => [
[
"match" => [
[
"profile_id_document" => 32,
"type" => "Document"
]
]
],
[
"match" => [
"type" => "Faq"
]
],
[
"match" => [
"type" => "NormativeDocument"
]
]
],
]
]
]
];
it doesn't seems so difficult to do in SQL, but it seems impossible in elasticsearch. Can Anyone help me?