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
This commit is contained in:
Joshua Spence 2015-06-17 07:28:16 +10:00
parent 751162d363
commit a3010148e2

View file

@ -27,7 +27,15 @@ final class DivinerAtomSearchIndexer extends PhabricatorSearchDocumentIndexer {
PhabricatorSearchRelationship::RELATIONSHIP_BOOK, PhabricatorSearchRelationship::RELATIONSHIP_BOOK,
$atom->getBookPHID(), $atom->getBookPHID(),
DivinerBookPHIDType::TYPECONST, DivinerBookPHIDType::TYPECONST,
$book->getDateCreated()); PhabricatorTime::getNow());
$doc->addRelationship(
$atom->getGraphHash()
? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
: PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
$atom->getBookPHID(),
DivinerBookPHIDType::TYPECONST,
PhabricatorTime::getNow());
return $doc; return $doc;
} }