SolrQuery::addGroupSortField

(PECL solr >= 2.2.0)
Add a group sort field (group.sort parameter).
public SolrQuery SolrQuery::addGroupSortField ( string $field [, integer $order ] )

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

Parameters:
field

Field name

order

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

Returns:
Examples:
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
See also:

SolrQuery::setGroup() -

SolrQuery::addGroupField() -

SolrQuery::addGroupFunction() -

SolrQuery::addGroupQuery() -

SolrQuery::setGroupFacet() -

SolrQuery::setGroupOffset() -

SolrQuery::setGroupLimit() -

SolrQuery::setGroupMain() -

SolrQuery::setGroupNGroups() -

SolrQuery::setGroupTruncate() -

SolrQuery::setGroupFormat() -

SolrQuery::setGroupCachePercent() -

doc_php
2016-02-24 16:11:13
Comments
Leave a Comment

Please login to continue.