diff --git a/src/Api/Controllers/SearchController.php b/src/Api/Controllers/SearchController.php index ece7c2a..3ec0cf9 100644 --- a/src/Api/Controllers/SearchController.php +++ b/src/Api/Controllers/SearchController.php @@ -317,6 +317,15 @@ class SearchController extends ListDiscussionsController protected function buildTextQuery(string $search, User $actor, bool $needsScoring = false): BoolQuery { $textQuery = BoolQuery::create(); + // Low-weight prefix match on title.autocomplete for the full search page. + // Exact / normal title matches should still rank higher than prefix-only hits. + $textQuery->add( + (new MatchQuery('title.autocomplete', $search)) + ->operator('and') + ->boost(0.35), + 'should' + ); + if ($this->discussionSearcher?->enabled()) { $textQuery->add($this->buildShouldClauses($search, $this->discussionSearcher->boost()), 'should');