1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10:42:41 +01:00

Reduce Maniphest fulltext limit from PHP_INT_MAX to 10k

Summary:
PHP_INT_MAX is rejected by ElasticSearch since it's outside of the representable integer range (see: <https://gist.github.com/JustinTulloss/c4ac0e1c93d6d1e91744>).

Just use 10K, as matching more than 10K results probably isn't useful to anyone.

Test Plan: Confirmed this fixes the issue in IRC. Ran a fulltext search.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7097
This commit is contained in:
epriestley 2013-09-24 10:50:56 -07:00
parent 6b245c0665
commit 79ec5222a5

View file

@ -482,7 +482,10 @@ final class ManiphestTaskQuery
// fulltext search, and then use that to limit the rest of the search
$fulltext_query = new PhabricatorSearchQuery();
$fulltext_query->setQuery($this->fullTextSearch);
$fulltext_query->setParameter('limit', PHP_INT_MAX);
// 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', ManiphestPHIDTypeTask::TYPECONST);
$engine = PhabricatorSearchEngineSelector::newSelector()->newEngine();