SolrCollapseFunction::setMax

(PECL solr >= 2.2.0)

SolrCollapseFunction::setMaxSelects the group heads by the max value of a numeric field or function query

说明

public SolrCollapseFunction::setMax ( string $max ) : SolrCollapseFunction

Selects the group heads by the max value of a numeric field or function query.

参数

max

范例

Example #1 SolrCollapseFunction::setMax() example

<?php

$func 
= new SolrCollapseFunction('field_name');

$func->setMax('sum(cscore(),field(some_field))');

$query = new SolrQuery('*:*');

$query->collapse($func);

?>
相关文章
php deque reduces the deque to a single value using a callback functionphp map updates all values by applying a callback function to each valuephp sequence reduces the sequence to a single value using a callback functionphp set reduces the set to a single value using a callback functionphp fdf 函数 call a user defined function for each document valuephp ingres 函数 get the name of a field in a query resultphp sqlite 函数 executes a query and returns either an array for one single column or the value of the first rowphp intlcalendar get the value for a fieldphp intlcalendar the maximum value for a field considering the objectʼs current timephp intlcalendar get the global minimum value for a fieldphp intldateformatter parse string to a field based time valuephp solrcollapsefunction selects the group heads by the max value of a numeric field or function queryphp solrcollapsefunction sets the initial size of the collapse data structures when collapsing on a numeric field onlyphp solrcollapsefunction sets the initial size of the collapse data structures when collapsing on a numeric field onlyphp solrdismaxquery adds a boost query field with value and optional boost bq parameter php solrdismaxquery removes a query field qf parameter php solrquery add a field to be used to group resultsphp solrquery allows grouping results based on the unique values of a function query group.func parameter php solrquery add a group sort field group.sort parameter php solrquery returns the group.truncate value
关注编程学问公众号