Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/engine/PhabricatorPasteFulltextEngine.php
- This file was added.
<?php | |||||
final class PhabricatorPasteFulltextEngine | |||||
extends PhabricatorFulltextEngine { | |||||
protected function buildAbstractDocument( | |||||
PhabricatorSearchAbstractDocument $document, | |||||
$object) { | |||||
$paste = id(new PhabricatorPasteQuery()) | |||||
->setViewer($this->getViewer()) | |||||
->withPHIDs(array($object->getPHID())) | |||||
->needContent(true) | |||||
->executeOne(); | |||||
$document->setDocumentTitle($paste->getFullName()); | |||||
amckinley: It looks like if I use `$paste->getTitle()` and that returns `null`, the document gets indexed… | |||||
$document->addRelationship( | |||||
$paste->isArchived() | |||||
? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED | |||||
: PhabricatorSearchRelationship::RELATIONSHIP_OPEN, | |||||
$paste->getPHID(), | |||||
PhabricatorSlowvotePollPHIDType::TYPECONST, | |||||
epriestleyAuthorUnsubmitted Not Done Inline ActionsSlowvote copy/paste mishap. epriestley: Slowvote copy/paste mishap. | |||||
PhabricatorTime::getNow()); | |||||
$document->addField( | |||||
PhabricatorSearchDocumentFieldType::FIELD_BODY, | |||||
$paste->getContent()); | |||||
$document->addRelationship( | |||||
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, | |||||
$paste->getAuthorPHID(), | |||||
PhabricatorPeopleUserPHIDType::TYPECONST, | |||||
$paste->getDateCreated()); | |||||
} | |||||
} |
It looks like if I use $paste->getTitle() and that returns null, the document gets indexed without errors, but it doesn't come back in the search results?