Differential D17615 Diff 42360 src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
| Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | private function buildSpec(PhabricatorSavedQuery $query) { | ||||
| $offset = (int)$query->getParameter('offset', 0); | $offset = (int)$query->getParameter('offset', 0); | ||||
| $limit = (int)$query->getParameter('limit', 101); | $limit = (int)$query->getParameter('limit', 101); | ||||
| if ($offset + $limit > 10000) { | if ($offset + $limit > 10000) { | ||||
| throw new Exception(pht( | throw new Exception(pht( | ||||
| 'Query offset is too large. offset+limit=%s (max=%s)', | 'Query offset is too large. offset+limit=%s (max=%s)', | ||||
| $offset + $limit, | $offset + $limit, | ||||
| 10000)); | 10000)); | ||||
| } | } | ||||
| $spec['from'] = $offset; | $spec['from'] = 0; | ||||
| $spec['size'] = $limit; | $spec['size'] = $offset + $limit; | ||||
| return $spec; | return $spec; | ||||
| } | } | ||||
| public function executeSearch(PhabricatorSavedQuery $query) { | public function executeSearch(PhabricatorSavedQuery $query) { | ||||
| $types = $query->getParameter('types'); | $types = $query->getParameter('types'); | ||||
| if (!$types) { | if (!$types) { | ||||
| $types = array_keys( | $types = array_keys( | ||||
| ▲ Show 20 Lines • Show All 302 Lines • Show Last 20 Lines | |||||