Browse Source

enclose bestbet searches in quotes if it isnt already

2.x
Paul Pound 10 months ago
parent
commit
d965873e4c
  1. 5
      modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php

5
modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php

@ -67,6 +67,11 @@ class RoblibSearchSolrsiteController extends ControllerBase {
if ($solr_type == 'BestBet') { if ($solr_type == 'BestBet') {
$query->addCondition('type', 'bestbet', '='); $query->addCondition('type', 'bestbet', '=');
$query->setFulltextFields(['title_1']); $query->setFulltextFields(['title_1']);
if(str_starts_with($queryString, '"')) {
$query->keys($queryString);
} else {
$query->keys('"'.$queryString.'"');
}
} else { } else {
$query->addCondition('type', 'bestbet', '<>'); $query->addCondition('type', 'bestbet', '<>');
} }

Loading…
Cancel
Save