Differential D16945 Diff 40788 src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php
Show First 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | private function newFulltextSubquery( | ||||
$document_table = $document->getTableName(); | $document_table = $document->getTableName(); | ||||
$select = array(); | $select = array(); | ||||
$select[] = 'document.phid AS documentPHID'; | $select[] = 'document.phid AS documentPHID'; | ||||
$join = array(); | $join = array(); | ||||
$where = array(); | $where = array(); | ||||
$title_field = PhabricatorSearchDocumentFieldType::FIELD_TITLE; | |||||
$title_boost = 1024; | |||||
$raw_query = $query->getParameter('query'); | $raw_query = $query->getParameter('query'); | ||||
$compiled_query = $this->compileQuery($raw_query); | $compiled_query = $this->compileQuery($raw_query); | ||||
if (strlen($compiled_query)) { | if (strlen($compiled_query)) { | ||||
$select[] = qsprintf( | $select[] = qsprintf( | ||||
$conn, | $conn, | ||||
'IF(field.field = %s, %d, 0) + '. | |||||
'MATCH(corpus) AGAINST (%s IN BOOLEAN MODE) AS fieldScore', | 'MATCH(corpus) AGAINST (%s IN BOOLEAN MODE) AS fieldScore', | ||||
$title_field, | |||||
$title_boost, | |||||
$compiled_query); | $compiled_query); | ||||
$join[] = qsprintf( | $join[] = qsprintf( | ||||
$conn, | $conn, | ||||
'%T field ON field.phid = document.phid', | '%T field ON field.phid = document.phid', | ||||
$field_table); | $field_table); | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines |