@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
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make PhameBlog full text searchable

Summary: Ref T9897, makes blogs searchable

Test Plan: Make a blog, index it, search for it.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D16119

+44 -1
+3
src/__phutil_library_map__.php
··· 3764 3764 'PhameBlogEditEngine' => 'applications/phame/editor/PhameBlogEditEngine.php', 3765 3765 'PhameBlogEditor' => 'applications/phame/editor/PhameBlogEditor.php', 3766 3766 'PhameBlogFeedController' => 'applications/phame/controller/blog/PhameBlogFeedController.php', 3767 + 'PhameBlogFulltextEngine' => 'applications/phame/search/PhameBlogFulltextEngine.php', 3767 3768 'PhameBlogListController' => 'applications/phame/controller/blog/PhameBlogListController.php', 3768 3769 'PhameBlogListView' => 'applications/phame/view/PhameBlogListView.php', 3769 3770 'PhameBlogManageController' => 'applications/phame/controller/blog/PhameBlogManageController.php', ··· 8615 8616 'PhabricatorDestructibleInterface', 8616 8617 'PhabricatorApplicationTransactionInterface', 8617 8618 'PhabricatorConduitResultInterface', 8619 + 'PhabricatorFulltextInterface', 8618 8620 ), 8619 8621 'PhameBlog404Controller' => 'PhameLiveController', 8620 8622 'PhameBlogArchiveController' => 'PhameBlogController', ··· 8625 8627 'PhameBlogEditEngine' => 'PhabricatorEditEngine', 8626 8628 'PhameBlogEditor' => 'PhabricatorApplicationTransactionEditor', 8627 8629 'PhameBlogFeedController' => 'PhameBlogController', 8630 + 'PhameBlogFulltextEngine' => 'PhabricatorFulltextEngine', 8628 8631 'PhameBlogListController' => 'PhameBlogController', 8629 8632 'PhameBlogListView' => 'AphrontTagView', 8630 8633 'PhameBlogManageController' => 'PhameBlogController',
+5
src/applications/phame/phid/PhabricatorPhameBlogPHIDType.php
··· 34 34 $handle->setName($blog->getName()); 35 35 $handle->setFullName($blog->getName()); 36 36 $handle->setURI('/phame/blog/view/'.$blog->getID().'/'); 37 + 38 + if ($blog->isArchived()) { 39 + $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED); 40 + } 41 + 37 42 } 38 43 } 39 44
+28
src/applications/phame/search/PhameBlogFulltextEngine.php
··· 1 + <?php 2 + 3 + final class PhameBlogFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $blog = $object; 11 + 12 + $document->setDocumentTitle($blog->getName()); 13 + 14 + $document->addField( 15 + PhabricatorSearchDocumentFieldType::FIELD_BODY, 16 + $blog->getDescription()); 17 + 18 + $document->addRelationship( 19 + $blog->isArchived() 20 + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 21 + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 22 + $blog->getPHID(), 23 + PhabricatorPhameBlogPHIDType::TYPECONST, 24 + PhabricatorTime::getNow()); 25 + 26 + } 27 + 28 + }
+8 -1
src/applications/phame/storage/PhameBlog.php
··· 9 9 PhabricatorProjectInterface, 10 10 PhabricatorDestructibleInterface, 11 11 PhabricatorApplicationTransactionInterface, 12 - PhabricatorConduitResultInterface { 12 + PhabricatorConduitResultInterface, 13 + PhabricatorFulltextInterface { 13 14 14 15 const MARKUP_FIELD_DESCRIPTION = 'markup:description'; 15 16 ··· 369 370 return array(); 370 371 } 371 372 373 + 374 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 375 + 376 + public function newFulltextEngine() { 377 + return new PhameBlogFulltextEngine(); 378 + } 372 379 373 380 }