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 sequence updates all values by applying a callback function to each valuephp sequence reduces the sequence 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 session pgsql 函数 get custom field valuephp sqlite 函数 executes a query and returns either an array for one single column or the value of the first rowphp uopz 函数 gets a previous set return value for a functionphp uopz 函数 unsets a previously set return value for a functionphp intlcalendar get the value for a fieldphp intlcalendar the maximum value for a field considering the objectʼs current timephp intlcalendar the minimum value for a field considering the objectʼs current timephp intldateformatter parse string to a field based time valuephp memcached increment numeric item s value stored on a specific serverphp mongocursor adds a top level key/value pair to a queryphp 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 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
关注编程学问公众号