1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-28 07:28:20 +01:00
phorge-phorge/src/applications/diviner/search/DivinerBookSearchIndexer.php

26 lines
578 B
PHP
Raw Normal View History

<?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;
}
}