From a3010148e24d0750fd3a279baeb9cac9632adc02 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Wed, 17 Jun 2015 07:28:16 +1000 Subject: [PATCH] Mark diviner atoms as closed in search index Summary: Ref T4558. If a Diviner atom is a ghost (i.e. the underlying source code has been removed), mark it as closed in the search index. Test Plan: Searched for a ghost atom in global searcn and saw the results show "Closed". Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T4558 Differential Revision: https://secure.phabricator.com/D13297 --- .../diviner/search/DivinerAtomSearchIndexer.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/applications/diviner/search/DivinerAtomSearchIndexer.php b/src/applications/diviner/search/DivinerAtomSearchIndexer.php index ea134058f6..51a3866641 100644 --- a/src/applications/diviner/search/DivinerAtomSearchIndexer.php +++ b/src/applications/diviner/search/DivinerAtomSearchIndexer.php @@ -27,7 +27,15 @@ final class DivinerAtomSearchIndexer extends PhabricatorSearchDocumentIndexer { PhabricatorSearchRelationship::RELATIONSHIP_BOOK, $atom->getBookPHID(), DivinerBookPHIDType::TYPECONST, - $book->getDateCreated()); + PhabricatorTime::getNow()); + + $doc->addRelationship( + $atom->getGraphHash() + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, + $atom->getBookPHID(), + DivinerBookPHIDType::TYPECONST, + PhabricatorTime::getNow()); return $doc; }