From 0b1765bb3a90fcc003bf0831b33a76ce7e731d0c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 22 Aug 2019 15:50:56 +0200 Subject: [PATCH] wip #2956 @0.5 --- src/app/Magic/Search.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/Magic/Search.php b/src/app/Magic/Search.php index 06a2905..0c298ed 100644 --- a/src/app/Magic/Search.php +++ b/src/app/Magic/Search.php @@ -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); -- 2.39.5