]> _ Git - cubist_cms-back.git/commitdiff
wip #2956 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 22 Aug 2019 13:50:56 +0000 (15:50 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 22 Aug 2019 13:50:56 +0000 (15:50 +0200)
src/app/Magic/Search.php

index 06a2905082558d2d530101dbde0acd0aa1f1019d..0c298edc7ba484bf1438dc8e31b47616254bf2e3 100644 (file)
@@ -211,16 +211,20 @@ class Search
                 'from' => 0,
                 'size' => $limit,
                 'query' => [
-                    'multi_match' => [
-                        'query' => $term,
-                        'fields' => $queryfields,
+                    'bool' => [
+                        'must' => [
+                            'multi_match' => [
+                                'query' => $term,
+                                'fields' => $queryfields,
+                            ]
+                        ]
                     ]
                 ]
             ]
         ];
 
         if (null !== $type) {
-            $request['body']['query']['filter'] = ['term' => ['type' => $type]];
+            $request['body']['query']['bool']['filter'] = ['term' => ['type' => $type]];
         }
 
         $res = \Elasticsearch::search($request);