本文整理匯總了PHP中ResultSet::getTotalHits方法的典型用法代碼示例。如果您正苦於以下問題:PHP ResultSet::getTotalHits方法的具體用法?PHP ResultSet::getTotalHits怎麽用?PHP ResultSet::getTotalHits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ResultSet
的用法示例。
在下文中一共展示了ResultSet::getTotalHits方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getDocuments
public function getDocuments()
{
$documents = array();
$total = $start = 0;
$queryString = $this->params['query'];
$offset = $this->params['offset'];
$limit = $this->params['limit'];
$size = 1000;
$options = $this->params;
$options['limit'] = $size;
$options['language'] = $this->params['sourcelanguage'];
do {
$options['offset'] = $start;
$this->resultset = $this->server->search($queryString, $options, $this->hl);
list($results, $offsets) = $this->extractMessages($this->resultset, $offset, $limit);
$offset = $offsets['start'] + $offsets['left'] - $offsets['total'];
$limit = $limit - $offsets['left'];
$total = $total + $offsets['total'];
$documents = array_merge($documents, $results);
$start = $start + $size;
} while ($offsets['start'] + $offsets['left'] >= $offsets['total'] && $this->resultset->getTotalHits() > $start);
$this->total = $total;
return $documents;
}
開發者ID:HuijiWiki,項目名稱:mediawiki-extensions-Translate,代碼行數:24,代碼來源:CrossLanguageTranslationSearchQuery.php