Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit b916722151eea73d073d59b1fae5e94bf403c225 1 parent f04d8ab
vrana authored
11 src/applications/search/index/indexer/differential/PhabricatorSearchDifferentialIndexer.php
View
@@ -52,15 +52,18 @@ public static function indexRevision(DifferentialRevision $rev) {
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());
1  src/applications/search/index/indexer/differential/__init__.php
View
@@ -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');
Please sign in to comment.
Something went wrong with that request. Please try again.