Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/index/PhabricatorSearchDocumentIndexer.php
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | abstract class PhabricatorSearchDocumentIndexer extends Phobject { | ||||
} | } | ||||
protected function newDocument($phid) { | protected function newDocument($phid) { | ||||
return id(new PhabricatorSearchAbstractDocument()) | return id(new PhabricatorSearchAbstractDocument()) | ||||
->setPHID($phid) | ->setPHID($phid) | ||||
->setDocumentType(phid_get_type($phid)); | ->setDocumentType(phid_get_type($phid)); | ||||
} | } | ||||
protected function indexTransactions( | |||||
PhabricatorSearchAbstractDocument $doc, | |||||
PhabricatorApplicationTransactionQuery $query, | |||||
array $phids) { | |||||
$xactions = id(clone $query) | |||||
->setViewer($this->getViewer()) | |||||
->withObjectPHIDs($phids) | |||||
->execute(); | |||||
foreach ($xactions as $xaction) { | |||||
if (!$xaction->hasComment()) { | |||||
continue; | |||||
} | |||||
$comment = $xaction->getComment(); | |||||
$doc->addField( | |||||
PhabricatorSearchDocumentFieldType::FIELD_COMMENT, | |||||
$comment->getContent()); | |||||
} | |||||
} | |||||
} | } |