Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/index/PhabricatorIndexEngine.php
- This file was moved from src/applications/search/index/PhabricatorSearchIndexer.php.
<?php | <?php | ||||
final class PhabricatorSearchIndexer extends Phobject { | final class PhabricatorIndexEngine extends Phobject { | ||||
public function queueDocumentForIndexing($phid, $context = null) { | |||||
PhabricatorWorker::scheduleTask( | |||||
'PhabricatorSearchWorker', | |||||
array( | |||||
'documentPHID' => $phid, | |||||
'context' => $context, | |||||
), | |||||
array( | |||||
'priority' => PhabricatorWorker::PRIORITY_IMPORT, | |||||
)); | |||||
} | |||||
public function indexDocumentByPHID($phid, $context) { | public function indexDocumentByPHID($phid, $context) { | ||||
$indexers = id(new PhutilClassMapQuery()) | $indexers = id(new PhutilClassMapQuery()) | ||||
->setAncestorClass('PhabricatorSearchDocumentIndexer') | ->setAncestorClass('PhabricatorSearchDocumentIndexer') | ||||
->execute(); | ->execute(); | ||||
foreach ($indexers as $indexer) { | foreach ($indexers as $indexer) { | ||||
if ($indexer->shouldIndexDocumentByPHID($phid)) { | if ($indexer->shouldIndexDocumentByPHID($phid)) { | ||||
Show All 9 Lines |