Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/search/DivinerBookSearchIndexer.php
| Show All 13 Lines | $doc = $this->newDocument($phid) | ||||
| ->setDocumentCreated($book->getDateCreated()) | ->setDocumentCreated($book->getDateCreated()) | ||||
| ->setDocumentModified($book->getDateModified()); | ->setDocumentModified($book->getDateModified()); | ||||
| $doc->addField( | $doc->addField( | ||||
| PhabricatorSearchDocumentFieldType::FIELD_BODY, | PhabricatorSearchDocumentFieldType::FIELD_BODY, | ||||
| $book->getPreface()); | $book->getPreface()); | ||||
| $doc->addRelationship( | $doc->addRelationship( | ||||
| $book->getIsArchived() | |||||
| ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED | |||||
| : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, | |||||
| $book->getPHID(), | |||||
| DivinerBookPHIDType::TYPECONST, | |||||
| PhabricatorTime::getNow()); | |||||
| $doc->addRelationship( | |||||
| PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, | PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, | ||||
| $book->getRepositoryPHID(), | $book->getRepositoryPHID(), | ||||
| PhabricatorRepositoryRepositoryPHIDType::TYPECONST, | PhabricatorRepositoryRepositoryPHIDType::TYPECONST, | ||||
| $book->getDateCreated()); | $book->getDateCreated()); | ||||
| $this->indexTransactions( | $this->indexTransactions( | ||||
| $doc, | $doc, | ||||
| new DivinerLiveBookTransactionQuery(), | new DivinerLiveBookTransactionQuery(), | ||||
| array($phid)); | array($phid)); | ||||
| return $doc; | return $doc; | ||||
| } | } | ||||
| } | } | ||||