1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

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
This commit is contained in:
Povilas Balzaravicius Pawka 2015-04-24 11:16:40 -07:00 committed by epriestley
parent 6f1b39c0b8
commit 7196d29c0c

View file

@ -560,7 +560,8 @@ final class ManiphestTaskQuery extends PhabricatorCursorPagedPolicyAwareQuery {
// NOTE: Setting this to something larger than 2^53 will raise errors in // NOTE: Setting this to something larger than 2^53 will raise errors in
// ElasticSearch, and billions of results won't fit in memory anyway. // ElasticSearch, and billions of results won't fit in memory anyway.
$fulltext_query->setParameter('limit', 100000); $fulltext_query->setParameter('limit', 100000);
$fulltext_query->setParameter('type', ManiphestTaskPHIDType::TYPECONST); $fulltext_query->setParameter('types',
array(ManiphestTaskPHIDType::TYPECONST));
$engine = PhabricatorSearchEngineSelector::newSelector()->newEngine(); $engine = PhabricatorSearchEngineSelector::newSelector()->newEngine();
$fulltext_results = $engine->executeSearch($fulltext_query); $fulltext_results = $engine->executeSearch($fulltext_query);