From d965873e4cbef21ac5034deb9fc17bed86191e93 Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Tue, 9 Jan 2024 14:13:18 -0400 Subject: [PATCH] enclose bestbet searches in quotes if it isnt already --- .../src/Controller/RoblibSearchSolrsiteController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php b/modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php index 2e695fe..c4b6e7c 100644 --- a/modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php +++ b/modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php @@ -67,6 +67,11 @@ class RoblibSearchSolrsiteController extends ControllerBase { if ($solr_type == 'BestBet') { $query->addCondition('type', 'bestbet', '='); $query->setFulltextFields(['title_1']); + if(str_starts_with($queryString, '"')) { + $query->keys($queryString); + } else { + $query->keys('"'.$queryString.'"'); + } } else { $query->addCondition('type', 'bestbet', '<>'); }