Hello,
I have a problem with filter in boolean query.
I want to apply a filter based on 3 fields with 1 minimum filter match :
$params = [
'from' => 0,
'size' => 25,
'index' => 'document',
'body' => [
'query' => [
'bool' => [
'filter' => [
'bool' => [
'minimum_should_match' => 1,
'should' => [
'term' => [
'VISIBILITE' => 'T'
],
'term' => [
'ECRITURE' => 'M'
],
'term' => [
'LECTURE' => 'M'
],
]
]
],
'must' => [
[
'bool' => [
'should' => [
[
'match' => [
'OBJET' => $recherche,
]
],
[
'match' => [
'TYPEDOCUMENT' => $recherche
]
],
[
'match' => [
'NOMPERSONNE' => $recherche
]
],
[
'match' => [
'PRENOMPERSONNE' => $recherche
]
],
[
'match' => [
'NUMDOCUMENT' => [
'query' => $recherche,
'boost' => 2
]
]
],
[
'match' => [
'MOTCLES' => $recherche
]
],
]
]
],
],
],
],
],
];
I get no result with this query, however i see lots of relevant documents in index.