diff --git a/components/SolrSearchExtraBundle/src/lib/Query/Content/Criterion/MultipleFieldsFullText.php b/components/SolrSearchExtraBundle/src/lib/Query/Content/Criterion/MultipleFieldsFullText.php index 91929f552..a544ad97d 100644 --- a/components/SolrSearchExtraBundle/src/lib/Query/Content/Criterion/MultipleFieldsFullText.php +++ b/components/SolrSearchExtraBundle/src/lib/Query/Content/Criterion/MultipleFieldsFullText.php @@ -125,6 +125,13 @@ class MultipleFieldsFullText extends Criterion implements CustomFieldInterface */ public $boostFunctions = []; + /** + * Array of boost queries. + * + * @var array + */ + public $boostQueries = []; + /** * @param $value */ diff --git a/components/SolrSearchExtraBundle/src/lib/Query/Content/CriterionVisitor/MultipleFieldsFullText.php b/components/SolrSearchExtraBundle/src/lib/Query/Content/CriterionVisitor/MultipleFieldsFullText.php index b1e3461f7..85f29d83b 100644 --- a/components/SolrSearchExtraBundle/src/lib/Query/Content/CriterionVisitor/MultipleFieldsFullText.php +++ b/components/SolrSearchExtraBundle/src/lib/Query/Content/CriterionVisitor/MultipleFieldsFullText.php @@ -118,9 +118,18 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null) reset($boostFunction) : sprintf('sum(%s)', implode(',', $boostFunction)); } + if (!empty($criterion->boostQueries)) { + $queryParams['bq'] = $criterion->boostQueries; + } $queryParamsString = implode(' ', array_map(function ($key, $value) { - return "{$key}='{$value}'"; + if (is_array($value)) { + return implode(' ', array_map(function ($value) use ($key) { + return "{$key}='{$value}'"; + }, $value)); + } else { + return "{$key}='{$value}'"; + } }, array_keys($queryParams), $queryParams)); return "{!edismax {$queryParamsString}}";