From 7196d29c0c57ca24e691c83a6bdd7a5d74e19000 Mon Sep 17 00:00:00 2001 From: Povilas Balzaravicius Pawka Date: Fri, 24 Apr 2015 11:16:40 -0700 Subject: [PATCH] Fix query types on maniphest fulltext search. Summary: Parameter `type` is not used anywhere. Instead param `types` is used. Due this bug search was performed over whole index instead on tasks only. Test Plan: - Setup phabricator to run with Elasticsearch. - Open http://yourphab.com/conduit/method/maniphest.query/ - Fill `fullText` field only. - Expect get results. Query should be performed on `/phabricator/TASK/` only (not on whole `/phabricator/` index). Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12542 --- src/applications/maniphest/query/ManiphestTaskQuery.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/applications/maniphest/query/ManiphestTaskQuery.php b/src/applications/maniphest/query/ManiphestTaskQuery.php index 1b988ab4c6..60e3425af6 100644 --- a/src/applications/maniphest/query/ManiphestTaskQuery.php +++ b/src/applications/maniphest/query/ManiphestTaskQuery.php @@ -560,7 +560,8 @@ final class ManiphestTaskQuery extends PhabricatorCursorPagedPolicyAwareQuery { // NOTE: Setting this to something larger than 2^53 will raise errors in // ElasticSearch, and billions of results won't fit in memory anyway. $fulltext_query->setParameter('limit', 100000); - $fulltext_query->setParameter('type', ManiphestTaskPHIDType::TYPECONST); + $fulltext_query->setParameter('types', + array(ManiphestTaskPHIDType::TYPECONST)); $engine = PhabricatorSearchEngineSelector::newSelector()->newEngine(); $fulltext_results = $engine->executeSearch($fulltext_query);