array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'solrcollapsefunction.setmax.php', 1 => 'SolrCollapseFunction::setMax', ), 'up' => array ( 0 => 'class.solrcollapsefunction.php', 1 => 'SolrCollapseFunction', ), 'prev' => array ( 0 => 'solrcollapsefunction.sethint.php', 1 => 'SolrCollapseFunction::setHint', ), 'next' => array ( 0 => 'solrcollapsefunction.setmin.php', 1 => 'SolrCollapseFunction::setMin', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/solr/solrcollapsefunction/setmax.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL solr >= 2.2.0)
SolrCollapseFunction::setMax — Selects the group heads by the max value of a numeric field or function query
Selects the group heads by the max value of a numeric field or function query.
max
例1 SolrCollapseFunction::setMax() example
<?php
$func = new SolrCollapseFunction('field_name');
$func->setMax('sum(cscore(),field(some_field))');
$query = new SolrQuery('*:*');
$query->collapse($func);
?>