@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Boost search result title matches

Summary: Ref T6740. When a query matches a document title, boost results.

Test Plan:
- Searched for `button bar`.
- Before:

{F2019463}

- After:

{F2019470}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6740

Differential Revision: https://secure.phabricator.com/D16945

+6
+6
src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php
··· 197 197 $join = array(); 198 198 $where = array(); 199 199 200 + $title_field = PhabricatorSearchDocumentFieldType::FIELD_TITLE; 201 + $title_boost = 1024; 202 + 200 203 $raw_query = $query->getParameter('query'); 201 204 $compiled_query = $this->compileQuery($raw_query); 202 205 if (strlen($compiled_query)) { 203 206 $select[] = qsprintf( 204 207 $conn, 208 + 'IF(field.field = %s, %d, 0) + '. 205 209 'MATCH(corpus) AGAINST (%s IN BOOLEAN MODE) AS fieldScore', 210 + $title_field, 211 + $title_boost, 206 212 $compiled_query); 207 213 208 214 $join[] = qsprintf(