Differential D17384 Diff 42244 src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php
<?php | <?php | ||||
final class PhabricatorMySQLFulltextStorageEngine | final class PhabricatorMySQLFulltextStorageEngine | ||||
extends PhabricatorFulltextStorageEngine { | extends PhabricatorFulltextStorageEngine { | ||||
public function getEngineIdentifier() { | public function getEngineIdentifier() { | ||||
return 'mysql'; | return 'mysql'; | ||||
} | } | ||||
public function getEnginePriority() { | public function getHostType() { | ||||
return 100; | return new PhabricatorMySQLSearchHost($this); | ||||
} | |||||
public function isEnabled() { | |||||
return true; | |||||
} | } | ||||
public function reindexAbstractDocument( | public function reindexAbstractDocument( | ||||
PhabricatorSearchAbstractDocument $doc) { | PhabricatorSearchAbstractDocument $doc) { | ||||
$phid = $doc->getPHID(); | $phid = $doc->getPHID(); | ||||
if (!$phid) { | if (!$phid) { | ||||
throw new Exception(pht('Document has no PHID!')); | throw new Exception(pht('Document has no PHID!')); | ||||
▲ Show 20 Lines • Show All 386 Lines • ▼ Show 20 Lines | private function compileQuery($raw_query) { | ||||
$queries[] = $compiler->compileStemmedQuery(); | $queries[] = $compiler->compileStemmedQuery(); | ||||
return implode(' ', array_filter($queries)); | return implode(' ', array_filter($queries)); | ||||
} | } | ||||
public function indexExists() { | public function indexExists() { | ||||
return true; | return true; | ||||
} | } | ||||
public function getIndexStats() { | |||||
return false; | |||||
} | |||||
} | } |