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

Remove "Contains Words" constraint from Maniphest

Summary:
Ref T12819. Obsoleted by the Ferret engine, which is unprototyping shortly.

This breaks compatibility in two ways:

- `maniphest.query` no longer supports "fullText" (now throws an explicit exception).
- Existing saved searches with a "Contains Words" constraint will no longer have that constraint.

It seems unlikely (?) that either of these are seeing too much use, and they should be easy to fix. I'll note them in the changelog.

Test Plan: Viewed Maniphest, no more "Contains Words" field. Called `maniphest.query` with "fullText", got explicit exception.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12819

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

+4 -47
+4 -1
src/applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php
··· 102 102 103 103 $full_text = $request->getValue('fullText'); 104 104 if ($full_text) { 105 - $query->withFullTextSearch($full_text); 105 + throw new Exception( 106 + pht( 107 + 'Parameter "fullText" is no longer supported. Use method '. 108 + '"maniphest.search" with the "query" constraint instead.')); 106 109 } 107 110 108 111 $status = $request->getValue('status');
-38
src/applications/maniphest/query/ManiphestTaskQuery.php
··· 24 24 private $subtaskIDs; 25 25 private $subtypes; 26 26 27 - private $fullTextSearch = ''; 28 - 29 27 private $status = 'status-any'; 30 28 const STATUS_ANY = 'status-any'; 31 29 const STATUS_OPEN = 'status-open'; ··· 115 113 return $this; 116 114 } 117 115 118 - public function withFullTextSearch($fulltext_search) { 119 - $this->fullTextSearch = $fulltext_search; 120 - return $this; 121 - } 122 - 123 116 public function setGroupBy($group) { 124 117 $this->groupBy = $group; 125 118 ··· 329 322 330 323 $where[] = $this->buildStatusWhereClause($conn); 331 324 $where[] = $this->buildOwnerWhereClause($conn); 332 - $where[] = $this->buildFullTextWhereClause($conn); 333 325 334 326 if ($this->taskIDs !== null) { 335 327 $where[] = qsprintf( ··· 479 471 } 480 472 481 473 return '('.implode(') OR (', $subclause).')'; 482 - } 483 - 484 - private function buildFullTextWhereClause(AphrontDatabaseConnection $conn) { 485 - if (!strlen($this->fullTextSearch)) { 486 - return null; 487 - } 488 - 489 - // In doing a fulltext search, we first find all the PHIDs that match the 490 - // fulltext search, and then use that to limit the rest of the search 491 - $fulltext_query = id(new PhabricatorSavedQuery()) 492 - ->setEngineClassName('PhabricatorSearchApplicationSearchEngine') 493 - ->setParameter('query', $this->fullTextSearch); 494 - 495 - // NOTE: Setting this to something larger than 10,000 will raise errors in 496 - // Elasticsearch, and billions of results won't fit in memory anyway. 497 - $fulltext_query->setParameter('limit', 10000); 498 - $fulltext_query->setParameter('types', 499 - array(ManiphestTaskPHIDType::TYPECONST)); 500 - 501 - $fulltext_results = PhabricatorSearchService::executeSearch( 502 - $fulltext_query); 503 - 504 - if (empty($fulltext_results)) { 505 - $fulltext_results = array(null); 506 - } 507 - 508 - return qsprintf( 509 - $conn, 510 - 'task.phid IN (%Ls)', 511 - $fulltext_results); 512 474 } 513 475 514 476 protected function buildJoinClauseParts(AphrontDatabaseConnection $conn) {
-8
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
··· 86 86 pht('Search for tasks with given subtypes.')) 87 87 ->setDatasource(new ManiphestTaskSubtypeDatasource()) 88 88 ->setIsHidden($hide_subtypes), 89 - id(new PhabricatorSearchTextField()) 90 - ->setLabel(pht('Contains Words')) 91 - ->setKey('fulltext'), 92 89 id(new PhabricatorSearchThreeStateField()) 93 90 ->setLabel(pht('Open Parents')) 94 91 ->setKey('hasParents') ··· 144 141 'statuses', 145 142 'priorities', 146 143 'subtypes', 147 - 'fulltext', 148 144 'hasParents', 149 145 'hasSubtasks', 150 146 'parentIDs', ··· 218 214 219 215 if ($map['hasSubtasks'] !== null) { 220 216 $query->withOpenSubtasks($map['hasSubtasks']); 221 - } 222 - 223 - if (strlen($map['fulltext'])) { 224 - $query->withFullTextSearch($map['fulltext']); 225 217 } 226 218 227 219 if ($map['parentIDs']) {