1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

Index revision comments

Summary: Only inlines were indexed (contrary to what comment claims).

Test Plan: Index one revision, check database.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2359
This commit is contained in:
vrana 2012-05-01 10:29:23 -07:00
parent f04d8ab1a7
commit b916722151
2 changed files with 8 additions and 4 deletions

View file

@ -52,15 +52,18 @@ final class PhabricatorSearchDifferentialIndexer
time());
}
$comments = id(new DifferentialInlineComment())->loadAllWhere(
'revisionID = %d AND commentID is not null',
$comments = id(new DifferentialComment())->loadAllWhere(
'revisionID = %d',
$rev->getID());
$inlines = id(new DifferentialInlineComment())->loadAllWhere(
'revisionID = %d AND commentID IS NOT NULL',
$rev->getID());
$touches = array();
foreach ($comments as $comment) {
foreach (array_merge($comments, $inlines) as $comment) {
if (strlen($comment->getContent())) {
// TODO: we should also index inline comments.
$doc->addField(
PhabricatorSearchField::FIELD_COMMENT,
$comment->getContent());

View file

@ -8,6 +8,7 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/storage/comment');
phutil_require_module('phabricator', 'applications/differential/storage/inlinecomment');
phutil_require_module('phabricator', 'applications/phid/constants');
phutil_require_module('phabricator', 'applications/phid/handle/data');