SolrCollapseFunction
PHP Manual

SolrCollapseFunction::setMax

(PECL solr >= 2.2.0)

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

Descrição

public SolrCollapseFunction SolrCollapseFunction::setMax ( string $max )

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

Parâmetros

max

Valor Retornado

SolrCollapseFunction

Exemplos

Exemplo #1 SolrCollapseFunction::setMax() example

<?php

$func 
= new SolrCollapseFunction('field_name');

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

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

$query->collapse($func);

?>

SolrCollapseFunction
PHP Manual