mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-05 19:38:27 +01:00
b9d004e9c4
Summary: Fixes T7458. Integrates #diviner into #applicationsearch by indexing `DivinerLiveBook` and `DivinerLiveSymbol` search documents. Depends on D13157. Test Plan: Ran `./bin/search index --all --type BOOK` and `./bin/search index --all --type ATOM` and then searched for various symbols via global search. Reviewers: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T7458 Differential Revision: https://secure.phabricator.com/D13090
25 lines
578 B
PHP
25 lines
578 B
PHP
<?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;
|
|
}
|
|
|
|
|
|
}
|