From f180d668152f13e94d80d7d2daac1a815ce9ea43 Mon Sep 17 00:00:00 2001 From: Daniel Klabbers Date: Thu, 23 Dec 2021 13:07:04 +0100 Subject: [PATCH] Revert "feat: add partial word match with low weighting" This reverts commit 0d51e5d9121b85b60f95c3f0821e1bdcc6080472. --- src/Api/Controllers/SearchController.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Api/Controllers/SearchController.php b/src/Api/Controllers/SearchController.php index 57b03b8..9bd9ae7 100644 --- a/src/Api/Controllers/SearchController.php +++ b/src/Api/Controllers/SearchController.php @@ -57,8 +57,7 @@ class SearchController extends ListDiscussionsController if (! empty($search)) { $filterQuery ->add($this->sentenceMatch($search)) - ->add($this->wordMatch($search)) - ->add($this->partialMatch($search)); + ->add($this->wordMatch($search)); } $builder = (new Builder($this->elastic)) @@ -199,13 +198,9 @@ class SearchController extends ListDiscussionsController protected function wordMatch(string $q) { - return (new MatchQuery('content', $q))->boost(.5); + return (new MatchQuery('content', $q))->boost(.3); } - protected function partialMatch(string $q) - { - return (new MatchQuery('content', "*$q*"))->boost(.2); - } protected function getGroups(User $actor): Collection {