@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhrictionContentSearchEngineAttachment
4 extends PhabricatorSearchEngineAttachment {
5
6 public function getAttachmentName() {
7 return pht('Document Content');
8 }
9
10 public function getAttachmentDescription() {
11 return pht('Get the content of documents or document histories.');
12 }
13
14 public function getAttachmentForObject($object, $data, $spec) {
15 if ($object instanceof PhrictionDocument) {
16 $content = $object->getContent();
17 } else {
18 $content = $object;
19 }
20
21 return array(
22 'title' => $content->getTitle(),
23 'path' => $content->getSlug(),
24 'authorPHID' => $content->getAuthorPHID(),
25 'content' => array(
26 'raw' => $content->getContent(),
27 ),
28 );
29 }
30
31}