$boolQuery->
addParameter('minimum_should_match', 1
);
$boolQuery->
add($this->
getBestFieldQuery($term), BoolQuery::SHOULD
);
foreach ($this->maxExpansions
as $field =>
$maxExpansion) { $boolQuery->
add($this->
getPhrasePrefixQuery($term,
$field,
$maxExpansion), BoolQuery::SHOULD
);
} return $boolQuery;
} private function getBestFieldQuery(string
$term): MultiMatchQuery
{ return new MultiMatchQuery( [ 'name^7',
'name.*_analyzer^7',
'keywords^5',
'keywords.*_analyzer^5',
'manufacturer.name^3',
'manufacturer.name.*_analyzer^3',
'shortDescription',