diff options
Diffstat (limited to 'includes/api/ApiQuerySearch.php')
-rw-r--r-- | includes/api/ApiQuerySearch.php | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index cb020fff..668f00e5 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -87,7 +87,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $this->dieUsage("{$what} search is disabled", "search-{$what}-disabled"); - $data = array (); + $titles = array (); $count = 0; while( $result = $matches->next() ) { if (++ $count > $limit) { @@ -102,20 +102,23 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $title = $result->getTitle(); if (is_null($resultPageSet)) { - $data[] = array( - 'ns' => intval($title->getNamespace()), - 'title' => $title->getPrefixedText()); + $vals = array(); + ApiQueryBase::addTitleInfo($vals, $title); + $fit = $this->getResult()->addValue(array('query', $this->getModuleName()), null, $vals); + if(!$fit) + { + $this->setContinueEnumParameter('offset', $params['offset'] + $count - 1); + break; + } } else { - $data[] = $title; + $titles[] = $title; } } if (is_null($resultPageSet)) { - $result = $this->getResult(); - $result->setIndexedTagName($data, 'p'); - $result->addValue('query', $this->getModuleName(), $data); + $this->getResult()->setIndexedTagName_internal(array('query', $this->getModuleName()), 'p'); } else { - $resultPageSet->populateFromTitles($data); + $resultPageSet->populateFromTitles($titles); } } @@ -170,6 +173,6 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiQuerySearch.php 44186 2008-12-03 19:33:57Z catrope $'; + return __CLASS__ . ': $Id: ApiQuerySearch.php 47865 2009-02-27 16:03:01Z catrope $'; } -} +}
\ No newline at end of file |