[
https://issues.apache.org/jira/browse/SOLR-5027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13788112#comment-13788112
]
Joel Bernstein commented on SOLR-5027:
--------------------------------------
fq={!collapse field=student max=marks}
Will be similar to the sql statement that you want. But that is a little
deceiving because only max and min are supported, other aggregation functions
such as sum() are not. You could pair the CollapsingQParserPlugin with the
stats component or in the future SOLR-5045 to do true aggregation.
> Result Set Collapse and Expand Plugins
> --------------------------------------
>
> Key: SOLR-5027
> URL: https://issues.apache.org/jira/browse/SOLR-5027
> Project: Solr
> Issue Type: New Feature
> Components: search
> Affects Versions: 5.0
> Reporter: Joel Bernstein
> Priority: Minor
> Attachments: SOLR-5027.patch, SOLR-5027.patch, SOLR-5027.patch,
> SOLR-5027.patch, SOLR-5027.patch
>
>
> This ticket introduces two new Solr plugins, the *CollapsingQParserPlugin*
> and the *ExpandComponent*.
> The *CollapsingQParserPlugin* is a PostFilter that performs field collapsing.
> Collapse based on the highest scoring document:
> {code}
> fq=(!collapse field=<field_name>}
> {code}
> Collapse based on the min value of a numeric field:
> {code}
> fq={!collapse field=<field_name> min=<field_name>}
> {code}
> Collapse based on the max value of a numeric field:
> {code}
> fq={!collapse field=<field_name> max=<field_name>}
> {code}
> Collapse with a null policy:
> {code}
> fq={!collapse field=<field_name> nullPolicy=<null_policy>}
> {code}
> There are three null policies:
> ignore : removes docs with a null value in the collapse field (default).
> expand : treats each doc with a null value in the collapse field as a
> separate group.
> collapse : collapses all docs with a null value into a single group using
> either highest score, or min/max.
> The *ExpandComponent* is a search component that takes the collapsed docList
> and expands the groups for a single page based on parameters provided.
> Initial syntax:
> expand=true - Turns on the expand component.
> expand.field=<field> - Expands results for this field
> expand.limit=5 - Limits the documents for each expanded group.
> expand.sort=<sort spec> - The sort spec for the expanded documents. Default
> is score.
> expand.rows=500 - The max number of expanded results to bring back. Default
> is 500.
> *Note:* Recent patches don't contain the expand component. The July 16 patch
> does. This will be brought back in when the collapse is finished, or possible
> moved to it's own ticket.
--
This message was sent by Atlassian JIRA
(v6.1#6144)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]