首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

SolrQuery::addGroupSortField

(PECL solr >= 2.2.0)

SolrQuery::addGroupSortField — Add a group sort field (group.sort parameter).

Description

代码语言:javascript
复制
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

Return Values

Examples

Example #1 SolrQuery::addGroupSortField() example

代码语言:javascript
复制
<?php

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

The above example will output something similar to:

代码语言:javascript
复制
q=*:*&group=true&group.sort=price asc

See Also

  • SolrQuery::setGroup() - Enable/Disable result grouping (group parameter)
  • SolrQuery::addGroupField() - Add a field to be used to group results.
  • SolrQuery::addGroupFunction() - Allows grouping results based on the unique values of a function query (group.func parameter).
  • SolrQuery::addGroupQuery() - Allows grouping of documents that match the given query.
  • SolrQuery::setGroupFacet() - Sets group.facet parameter
  • SolrQuery::setGroupOffset() - Sets the group.offset parameter.
  • SolrQuery::setGroupLimit() - Specifies the number of results to return for each group. The server default value is 1.
  • SolrQuery::setGroupMain() - If true, the result of the first field grouping command is used as the main result list in the response, using group.format=simple.
  • SolrQuery::setGroupNGroups() - If true, Solr includes the number of groups that have matched the query in the results.
  • SolrQuery::setGroupTruncate() - If true, facet counts are based on the most relevant document of each group matching the query.
  • SolrQuery::setGroupFormat() - Sets the group format, result structure (group.format parameter).
  • SolrQuery::setGroupCachePercent() - Enables caching for result grouping

← SolrQuery::addGroupQuery

SolrQuery::addHighlightField →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com