phpday 2025 - Call For Papers

SolrQuery::addGroupSortField

(PECL solr >= 2.2.0)

SolrQuery::addGroupSortFieldAdd a group sort field (group.sort parameter)

说明

public SolrQuery::addGroupSortField(string $field, int $order = ?): SolrQuery

Allow sorting group documents, using group sort field (group.sort parameter).

参数

field

Field name

order

Order ASC/DESC, utilizes SolrQuery::ORDER_* constants

返回值

示例

示例 #1 SolrQuery::addGroupSortField() example

<?php

$solrQuery
= new SolrQuery('*:*');
$solrQuery
->setGroup(true)
->
addGroupSortField('price', SolrQuery::ORDER_ASC);

echo
$solrQuery;
?>

以上示例的输出类似于:

q=*:*&group=true&group.sort=price asc

参见

添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top