本文整理汇总了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