Revert "feat: add partial word match with low weighting"

This reverts commit 0d51e5d912.
This commit is contained in:
Daniel Klabbers 2021-12-23 13:07:04 +01:00
parent 013f5162c5
commit f180d66815
1 changed files with 2 additions and 7 deletions

View File

@ -57,8 +57,7 @@ class SearchController extends ListDiscussionsController
if (! empty($search)) { if (! empty($search)) {
$filterQuery $filterQuery
->add($this->sentenceMatch($search)) ->add($this->sentenceMatch($search))
->add($this->wordMatch($search)) ->add($this->wordMatch($search));
->add($this->partialMatch($search));
} }
$builder = (new Builder($this->elastic)) $builder = (new Builder($this->elastic))
@ -199,13 +198,9 @@ class SearchController extends ListDiscussionsController
protected function wordMatch(string $q) 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 protected function getGroups(User $actor): Collection
{ {