From 4144f637fa6e33b7a4e7d99e128a056b6cdb5c68 Mon Sep 17 00:00:00 2001 From: Vincent Lopes-Vicente Date: Tue, 10 Dec 2019 09:48:00 +0100 Subject: [PATCH] Fix when "q" is empty on search --- Controller/SearchController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Controller/SearchController.php b/Controller/SearchController.php index ab18586..8c044a4 100644 --- a/Controller/SearchController.php +++ b/Controller/SearchController.php @@ -142,6 +142,10 @@ public function searchAction(Request $request) $textSearches = []; $refSearch = []; foreach ($searchWords as $searchWord) { + if ($searchWord === "") { + continue; + } + $textSearches[] = [ "multi_match" => [ "query" => $searchWord, @@ -405,4 +409,4 @@ protected function getDefaultPseFromSource($source) { } -} \ No newline at end of file +}