1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-25 06:50:55 +01:00

Add full text search to maniphest.query

Summary: ...also swapped "status" and "order" so "status" is first, as in my testing it was sub-optimal to specifiy status (more of "what i want") after order ("how I want it")

Test Plan: ran various queries on my test instance via conduit console and the results all seem correct

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1381

Differential Revision: https://secure.phabricator.com/D3028
This commit is contained in:
Bob Trahan 2012-07-23 09:14:45 -07:00
parent f5c08f113e
commit 96860c5cc1

View file

@ -33,13 +33,6 @@ class ConduitAPI_maniphest_query_Method
public function defineParamTypes() { public function defineParamTypes() {
$orders = array(
ManiphestTaskQuery::ORDER_PRIORITY,
ManiphestTaskQuery::ORDER_CREATED,
ManiphestTaskQuery::ORDER_MODIFIED,
);
$orders = implode(', ', $orders);
$statuses = array( $statuses = array(
ManiphestTaskQuery::STATUS_ANY, ManiphestTaskQuery::STATUS_ANY,
ManiphestTaskQuery::STATUS_OPEN, ManiphestTaskQuery::STATUS_OPEN,
@ -52,14 +45,22 @@ class ConduitAPI_maniphest_query_Method
); );
$statuses = implode(', ', $statuses); $statuses = implode(', ', $statuses);
$orders = array(
ManiphestTaskQuery::ORDER_PRIORITY,
ManiphestTaskQuery::ORDER_CREATED,
ManiphestTaskQuery::ORDER_MODIFIED,
);
$orders = implode(', ', $orders);
return array( return array(
'ownerPHIDs' => 'optional list', 'ownerPHIDs' => 'optional list',
'authorPHIDs' => 'optional list', 'authorPHIDs' => 'optional list',
'projectPHIDs' => 'optional list', 'projectPHIDs' => 'optional list',
'ccPHIDs' => 'optional list', 'ccPHIDs' => 'optional list',
'fullText' => 'optional string',
'order' => 'optional enum<'.$orders.'>',
'status' => 'optional enum<'.$statuses.'>', 'status' => 'optional enum<'.$statuses.'>',
'order' => 'optional enum<'.$orders.'>',
'limit' => 'optional int', 'limit' => 'optional int',
'offset' => 'optional int', 'offset' => 'optional int',
@ -98,9 +99,9 @@ class ConduitAPI_maniphest_query_Method
$query->withSubscribers($ccs); $query->withSubscribers($ccs);
} }
$order = $request->getValue('order'); $full_text = $request->getValue('fullText');
if ($order) { if ($full_text) {
$query->setOrderBy($order); $query->withFullTextSearch($full_text);
} }
$status = $request->getValue('status'); $status = $request->getValue('status');
@ -108,6 +109,11 @@ class ConduitAPI_maniphest_query_Method
$query->withStatus($status); $query->withStatus($status);
} }
$order = $request->getValue('order');
if ($order) {
$query->setOrderBy($order);
}
$limit = $request->getValue('limit'); $limit = $request->getValue('limit');
if ($limit) { if ($limit) {
$query->setLimit($limit); $query->setLimit($limit);