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:
parent
2082eda67b
commit
a6698f2ea5
2 changed files with 4 additions and 22 deletions
|
@ -66,27 +66,10 @@ final class PhabricatorRepositoryCommitSearchIndexer
|
||||||
PhabricatorRepositoryRepositoryPHIDType::TYPECONST,
|
PhabricatorRepositoryRepositoryPHIDType::TYPECONST,
|
||||||
$date_created);
|
$date_created);
|
||||||
|
|
||||||
$comments = PhabricatorAuditComment::loadComments(
|
$this->indexTransactions(
|
||||||
$this->getViewer(),
|
$doc,
|
||||||
$commit->getPHID());
|
new PhabricatorAuditTransactionQuery(),
|
||||||
foreach ($comments as $comment) {
|
array($commit->getPHID()));
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $doc;
|
return $doc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,6 @@ abstract class PhabricatorSearchDocumentIndexer {
|
||||||
$xactions = id(clone $query)
|
$xactions = id(clone $query)
|
||||||
->setViewer($this->getViewer())
|
->setViewer($this->getViewer())
|
||||||
->withObjectPHIDs($phids)
|
->withObjectPHIDs($phids)
|
||||||
->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT))
|
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
foreach ($xactions as $xaction) {
|
foreach ($xactions as $xaction) {
|
||||||
|
|
Loading…
Reference in a new issue