1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-31 22:48:16 +02:00

Add "fulltext" to Maniphest pro search

Summary: Restores this field to the new ApplicationSearch-based search.

Test Plan: Used fulltext search to find tasks.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D6950
This commit is contained in:
epriestley 2013-09-12 13:03:05 -07:00
parent a3c6e9aebf
commit f679ea7d7e
2 changed files with 14 additions and 1 deletions

View file

@ -425,7 +425,7 @@ final class ManiphestTaskQuery
} }
private function buildFullTextWhereClause(AphrontDatabaseConnection $conn) { private function buildFullTextWhereClause(AphrontDatabaseConnection $conn) {
if (!$this->fullTextSearch) { if (!strlen($this->fullTextSearch)) {
return null; return null;
} }
@ -434,6 +434,7 @@ final class ManiphestTaskQuery
$fulltext_query = new PhabricatorSearchQuery(); $fulltext_query = new PhabricatorSearchQuery();
$fulltext_query->setQuery($this->fullTextSearch); $fulltext_query->setQuery($this->fullTextSearch);
$fulltext_query->setParameter('limit', PHP_INT_MAX); $fulltext_query->setParameter('limit', PHP_INT_MAX);
$fulltext_query->setParameter('type', ManiphestPHIDTypeTask::TYPECONST);
$engine = PhabricatorSearchEngineSelector::newSelector()->newEngine(); $engine = PhabricatorSearchEngineSelector::newSelector()->newEngine();
$fulltext_results = $engine->executeSearch($fulltext_query); $fulltext_results = $engine->executeSearch($fulltext_query);

View file

@ -31,6 +31,8 @@ final class ManiphestTaskSearchEngine
} }
$saved->setParameter('ids', $ids); $saved->setParameter('ids', $ids);
$saved->setParameter('fulltext', $request->getStr('fulltext'));
return $saved; return $saved;
} }
@ -75,6 +77,11 @@ final class ManiphestTaskSearchEngine
$query->withIDs($ids); $query->withIDs($ids);
} }
$fulltext = $saved->getParameter('fulltext');
if (strlen($fulltext)) {
$query->withFullTextSearch($fulltext);
}
return $query; return $query;
} }
@ -158,6 +165,11 @@ final class ManiphestTaskSearchEngine
->setLabel(pht('Order')) ->setLabel(pht('Order'))
->setValue($saved->getParameter('order')) ->setValue($saved->getParameter('order'))
->setOptions($this->getOrderOptions())) ->setOptions($this->getOrderOptions()))
->appendChild(
id(new AphrontFormTextControl())
->setName('fulltext')
->setLabel(pht('Contains Text'))
->setValue($saved->getParameter('fulltext')))
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setName('ids') ->setName('ids')