Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/search/DivinerBookSearchIndexer.php
- This file was added.
| <?php | |||||
| final class DivinerBookSearchIndexer extends PhabricatorSearchDocumentIndexer { | |||||
| public function getIndexableObject() { | |||||
| return new DivinerLiveBook(); | |||||
| } | |||||
| protected function buildAbstractDocumentByPHID($phid) { | |||||
| $book = $this->loadDocumentByPHID($phid); | |||||
| $doc = $this->newDocument($phid) | |||||
| ->setDocumentTitle($book->getTitle()) | |||||
| ->setDocumentCreated($book->getDateCreated()) | |||||
| ->setDocumentModified($book->getDateModified()); | |||||
| $doc->addField( | |||||
| PhabricatorSearchField::FIELD_BODY, | |||||
| $book->getPreface()); | |||||
| return $doc; | |||||
| } | |||||
| } | |||||
epriestley: Why not index projects in this case? | |||||
Done Inline ActionsIIUC, books don't have projects at the moment, unless they inherit projects from a repository. We could maybe add projects to books, either through some edit interface or by specifying the projects in the book file. joshuaspence: IIUC, books don't have projects at the moment, unless they inherit projects from a repository. | |||||
Why not index projects in this case?