SolrCollapseFunction::setMax

(PECL solr >= 2.2.0)
Selects the group heads by the max value of a numeric field or function query.
public SolrCollapseFunction SolrCollapseFunction::setMax ( string $max )

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

Parameters:
max

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

Returns:

SolrCollapseFunction

Examples:
SolrCollapseFunction::setMax() example
1
2
3
4
5
6
7
8
9
10
11
<?php
 
$func new SolrCollapseFunction('field_name');
 
$func->setMax('sum(cscore(),field(some_field))');
 
$query new SolrQuery('*:*');
 
$query->collapse($func);
 
?>
doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.