Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/query/ManiphestTaskQuery.php
Show First 20 Lines • Show All 507 Lines • ▼ Show 20 Lines | private function buildFullTextWhereClause(AphrontDatabaseConnection $conn) { | ||||
} | } | ||||
// In doing a fulltext search, we first find all the PHIDs that match the | // In doing a fulltext search, we first find all the PHIDs that match the | ||||
// fulltext search, and then use that to limit the rest of the search | // fulltext search, and then use that to limit the rest of the search | ||||
$fulltext_query = id(new PhabricatorSavedQuery()) | $fulltext_query = id(new PhabricatorSavedQuery()) | ||||
->setEngineClassName('PhabricatorSearchApplicationSearchEngine') | ->setEngineClassName('PhabricatorSearchApplicationSearchEngine') | ||||
->setParameter('query', $this->fullTextSearch); | ->setParameter('query', $this->fullTextSearch); | ||||
// NOTE: Setting this to something larger than 2^53 will raise errors in | // NOTE: Setting this to something larger than 10,000 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', 10000); | ||||
epriestley: If you want to do this, let's do it in a separate change with clearer justification? I'm… | |||||
Not Done Inline ActionsFrom the 5.2 docs:
So we need to at least reduce it to 10,000. 20after4: From [[ https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from… | |||||
Not Done Inline ActionsI guess we don't have to keep this change since the storage engine already handles limiting the max value. 20after4: I guess we don't have to keep this change since the storage engine already handles limiting the… | |||||
$fulltext_query->setParameter('types', | $fulltext_query->setParameter('types', | ||||
array(ManiphestTaskPHIDType::TYPECONST)); | array(ManiphestTaskPHIDType::TYPECONST)); | ||||
$engine = PhabricatorFulltextStorageEngine::loadEngine(); | $fulltext_results = PhabricatorSearchService::executeSearch( | ||||
$fulltext_results = $engine->executeSearch($fulltext_query); | $fulltext_query); | ||||
Done Inline ActionsI'm not sure if a static call is the right way to go for this but it's slightly cleaner. 20after4: I'm not sure if a static call is the right way to go for this but it's slightly cleaner. | |||||
Done Inline ActionsThis is fine, this is kind of an unusual hack anyway. epriestley: This is fine, this is kind of an unusual hack anyway. | |||||
if (empty($fulltext_results)) { | if (empty($fulltext_results)) { | ||||
$fulltext_results = array(null); | $fulltext_results = array(null); | ||||
} | } | ||||
return qsprintf( | return qsprintf( | ||||
$conn, | $conn, | ||||
'task.phid IN (%Ls)', | 'task.phid IN (%Ls)', | ||||
▲ Show 20 Lines • Show All 377 Lines • Show Last 20 Lines |
If you want to do this, let's do it in a separate change with clearer justification? I'm assuming this is related to T12353 but from the downstream it looks like this wasn't actually a query size issue.
If we are ultimately reducing this with reasonable justification, I'd like to do something like this, which would be a slightly larger change: