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

Provide basic fulltext search for Conpherence

Summary: Ref T3165. This needs more work but does the basics.

Test Plan: {F387514}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T3165

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

+33 -1
+20 -1
src/applications/conpherence/query/ConpherenceThreadQuery.php
··· 17 17 private $afterTransactionID; 18 18 private $beforeTransactionID; 19 19 private $transactionLimit; 20 + private $fulltext; 20 21 21 22 public function needFilePHIDs($need_file_phids) { 22 23 $this->needFilePHIDs = $need_file_phids; ··· 80 81 81 82 public function getTransactionLimit() { 82 83 return $this->transactionLimit; 84 + } 85 + 86 + public function withFulltext($query) { 87 + $this->fulltext = $query; 88 + return $this; 83 89 } 84 90 85 91 protected function loadPage() { ··· 122 128 } 123 129 124 130 protected function buildGroupClause(AphrontDatabaseConnection $conn_r) { 125 - if ($this->participantPHIDs !== null) { 131 + if ($this->participantPHIDs !== null || strlen($this->fulltext)) { 126 132 return 'GROUP BY conpherence_thread.id'; 127 133 } else { 128 134 return $this->buildApplicationSearchGroupClause($conn_r); ··· 149 155 $viewer->getPHID()); 150 156 } 151 157 158 + if (strlen($this->fulltext)) { 159 + $joins[] = qsprintf( 160 + $conn_r, 161 + 'JOIN %T idx ON idx.threadPHID = conpherence_thread.phid', 162 + id(new ConpherenceIndex())->getTableName()); 163 + } 152 164 153 165 $joins[] = $this->buildApplicationSearchJoinClause($conn_r); 154 166 return implode(' ', $joins); ··· 194 206 $conn_r, 195 207 'conpherence_thread.isRoom = %d', 196 208 (int)$this->isRoom); 209 + } 210 + 211 + if (strlen($this->fulltext)) { 212 + $where[] = qsprintf( 213 + $conn_r, 214 + 'MATCH(idx.corpus) AGAINST (%s IN BOOLEAN MODE)', 215 + $this->fulltext); 197 216 } 198 217 199 218 $viewer = $this->getViewer();
+13
src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
··· 18 18 'participantPHIDs', 19 19 $this->readUsersFromRequest($request, 'participants')); 20 20 21 + $saved->setParameter('fulltext', $request->getStr('fulltext')); 22 + 21 23 $saved->setParameter( 22 24 'threadType', 23 25 $request->getStr('threadType')); ··· 32 34 $participant_phids = $saved->getParameter('participantPHIDs', array()); 33 35 if ($participant_phids && is_array($participant_phids)) { 34 36 $query->withParticipantPHIDs($participant_phids); 37 + } 38 + 39 + $fulltext = $saved->getParameter('fulltext'); 40 + if (strlen($fulltext)) { 41 + $query->withFulltext($fulltext); 35 42 } 36 43 37 44 $thread_type = $saved->getParameter('threadType'); ··· 57 64 PhabricatorSavedQuery $saved) { 58 65 59 66 $participant_phids = $saved->getParameter('participantPHIDs', array()); 67 + $fulltext = $saved->getParameter('fulltext'); 60 68 61 69 $form 62 70 ->appendControl( ··· 65 73 ->setName('participants') 66 74 ->setLabel(pht('Participants')) 67 75 ->setValue($participant_phids)) 76 + ->appendControl( 77 + id(new AphrontFormTextControl()) 78 + ->setName('fulltext') 79 + ->setLabel(pht('Contains Words')) 80 + ->setValue($fulltext)) 68 81 ->appendControl( 69 82 id(new AphrontFormSelectControl()) 70 83 ->setLabel(pht('Type'))