From 96860c5cc167926da041ebf0fd1cd7f19b3f1d1f Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Mon, 23 Jul 2012 09:14:45 -0700 Subject: [PATCH] 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 --- .../ConduitAPI_maniphest_query_Method.php | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_query_Method.php b/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_query_Method.php index 8be8af5c4d..dfabfab9c5 100644 --- a/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_query_Method.php +++ b/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_query_Method.php @@ -33,13 +33,6 @@ class ConduitAPI_maniphest_query_Method public function defineParamTypes() { - $orders = array( - ManiphestTaskQuery::ORDER_PRIORITY, - ManiphestTaskQuery::ORDER_CREATED, - ManiphestTaskQuery::ORDER_MODIFIED, - ); - $orders = implode(', ', $orders); - $statuses = array( ManiphestTaskQuery::STATUS_ANY, ManiphestTaskQuery::STATUS_OPEN, @@ -52,14 +45,22 @@ class ConduitAPI_maniphest_query_Method ); $statuses = implode(', ', $statuses); + $orders = array( + ManiphestTaskQuery::ORDER_PRIORITY, + ManiphestTaskQuery::ORDER_CREATED, + ManiphestTaskQuery::ORDER_MODIFIED, + ); + $orders = implode(', ', $orders); + return array( 'ownerPHIDs' => 'optional list', 'authorPHIDs' => 'optional list', 'projectPHIDs' => 'optional list', 'ccPHIDs' => 'optional list', + 'fullText' => 'optional string', - 'order' => 'optional enum<'.$orders.'>', 'status' => 'optional enum<'.$statuses.'>', + 'order' => 'optional enum<'.$orders.'>', 'limit' => 'optional int', 'offset' => 'optional int', @@ -98,9 +99,9 @@ class ConduitAPI_maniphest_query_Method $query->withSubscribers($ccs); } - $order = $request->getValue('order'); - if ($order) { - $query->setOrderBy($order); + $full_text = $request->getValue('fullText'); + if ($full_text) { + $query->withFullTextSearch($full_text); } $status = $request->getValue('status'); @@ -108,6 +109,11 @@ class ConduitAPI_maniphest_query_Method $query->withStatus($status); } + $order = $request->getValue('order'); + if ($order) { + $query->setOrderBy($order); + } + $limit = $request->getValue('limit'); if ($limit) { $query->setLimit($limit);