1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 22:40:55 +01:00

Use ApplicationTransactions when indexing commit/audit comments

Summary:
Ref T4896. Depends on D10056. Moves search indexing to standard infrastructure.

Also, fixes a bug where inline comments would not be indexed.

Test Plan: Used `bin/search index ... --trace` to view index construction of a commit, saw all the comments and inlines get indexed.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T4896

Differential Revision: https://secure.phabricator.com/D10057
This commit is contained in:
epriestley 2014-07-28 15:02:18 -07:00
parent 2082eda67b
commit a6698f2ea5
2 changed files with 4 additions and 22 deletions

View file

@ -66,27 +66,10 @@ final class PhabricatorRepositoryCommitSearchIndexer
PhabricatorRepositoryRepositoryPHIDType::TYPECONST,
$date_created);
$comments = PhabricatorAuditComment::loadComments(
$this->getViewer(),
$commit->getPHID());
foreach ($comments as $comment) {
if (strlen($comment->getContent())) {
$doc->addField(
PhabricatorSearchField::FIELD_COMMENT,
$comment->getContent());
}
}
$inlines = PhabricatorAuditInlineComment::loadPublishedComments(
$this->getViewer(),
$commit->getPHID());
foreach ($inlines as $inline) {
if (strlen($inline->getContent())) {
$doc->addField(
PhabricatorSearchField::FIELD_COMMENT,
$inline->getContent());
}
}
$this->indexTransactions(
$doc,
new PhabricatorAuditTransactionQuery(),
array($commit->getPHID()));
return $doc;
}

View file

@ -101,7 +101,6 @@ abstract class PhabricatorSearchDocumentIndexer {
$xactions = id(clone $query)
->setViewer($this->getViewer())
->withObjectPHIDs($phids)
->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT))
->execute();
foreach ($xactions as $xaction) {