Add Lucene Search
This commit is contained in:
parent
5b06be16f1
commit
2afe41ce79
4 changed files with 91 additions and 3 deletions
|
|
@ -158,7 +158,22 @@ class AdvancedSearchQuery {
|
|||
$q[] = $term->toSolrQuery($field_mapping);
|
||||
}
|
||||
$q = implode(' ', $q);
|
||||
|
||||
/** @var Solarium\QueryType\Select\Query\Query $solarium_query */
|
||||
// enable dismax search query option
|
||||
/** @var Solarium\QueryType\Select\Query\Component\DisMax $dismax */
|
||||
$dismax = $solarium_query->getDisMax();
|
||||
$dismax->setQueryParser('edismax');
|
||||
$query_fields = [];
|
||||
foreach ($field_mapping as $key => $field) {
|
||||
foreach ($field as $f => $item) {
|
||||
if (strpos($item, 'sticky') === false) {
|
||||
array_push($query_fields, $item);
|
||||
}
|
||||
}
|
||||
}
|
||||
$query_fields = implode(" ", array_unique($query_fields));
|
||||
$dismax->setQueryFields($query_fields);
|
||||
$solarium_query->setQuery($q);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue