略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: SolrQuery::addGroupSortField

2024-11-15

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

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/solrquery.addgroupsortfield.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3