(PECL solr >= 2.2.0)
SolrQuery::addGroupSortField — Add 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
Example #1 SolrQuery::addGroupSortField() example
<?php $solrQuery = new SolrQuery('*:*'); $solrQuery ->setGroup(true) ->addGroupSortField('price', SolrQuery::ORDER_ASC); echo $solrQuery; ?>
The above example will output something similar to:
q=*:*&group=true&group.sort=price asc
© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/solrquery.addgroupsortfield.php