[
https://issues.apache.org/jira/browse/SOLR-1682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yonik Seeley updated SOLR-1682:
-------------------------------
Attachment: SOLR-1682.patch
I'm getting back to grouping/collapsing... here's a development patch. I
cleaned up a bunch of stuff, took a shot at coming up with a good HTTP API and
response format, and enabled multiple field groupings in the same request.
HTTP params:
group=true/false (like faceting, turn on/off grouping)
group.query=<the query> - this is analogous to facet.query, but currently
not implemented
group.field=<the field> - group by a field
group.func=<the function> - group by a function
group.limit - the top number of groups to report back (default is equal to
the normal "limit" param, or 1 if unspecified)
group.docsPerGroup - the top number of documents per group to return
We'll need to be able to specify some of these per group. That hasn't been
implemented, but utilizing local params seems natural (since the alternate
f.<fieldname>.param method only works well with fields).
The "docsPerGroup" name seems a little more verbose than normal - anyone have
shorter ideas? Perhaps some kind of limit/offset params for the docs in a
group.
Here's an example of the current API:
http://localhost:8983/solr/select?wt=json&indent=true&q=*:*&fl=id&rows=3&group=true&group.docsPerGroup=2&group.field=popularity&group.func=add%28popularity,popularity%29
{code}
{
"responseHeader":{
"status":0,
"QTime":2,
"params":{
"fl":"id",
"indent":"true",
"q":"*:*",
"group.field":"popularity",
"group.func":"add(popularity,popularity)",
"group.docsPerGroup":"2",
"group":"true",
"wt":"json",
"rows":"3"}},
"grouped":{
"popularity":{
"groups":[{
"groupValue":6,
"matches":5,
"docs":{"numFound":5,"start":0,"docs":[
{
"id":"SP2514N"},
{
"id":"6H500F0"}]
}},
{
"groupValue":1,
"matches":2,
"docs":{"numFound":2,"start":0,"docs":[
{
"id":"F8V7067-APL-KIT"},
{
"id":"IW-02"}]
}},
{
"groupValue":10,
"matches":2,
"docs":{"numFound":2,"start":0,"docs":[
{
"id":"MA147LL/A"},
{
"id":"SOLR1000"}]
}}]},
"add(popularity,popularity)":{
"groups":[{
"groupValue":12.0,
"matches":5,
"docs":{"numFound":5,"start":0,"docs":[
{
"id":"SP2514N"},
{
"id":"6H500F0"}]
}},
{
"groupValue":2.0,
"matches":2,
"docs":{"numFound":2,"start":0,"docs":[
{
"id":"F8V7067-APL-KIT"},
{
"id":"IW-02"}]
}},
{
"groupValue":20.0,
"matches":2,
"docs":{"numFound":2,"start":0,"docs":[
{
"id":"MA147LL/A"},
{
"id":"SOLR1000"}]
}}]}}}
{code}
> Implement CollapseComponent
> ---------------------------
>
> Key: SOLR-1682
> URL: https://issues.apache.org/jira/browse/SOLR-1682
> Project: Solr
> Issue Type: Sub-task
> Components: search
> Reporter: Martijn van Groningen
> Assignee: Shalin Shekhar Mangar
> Fix For: Next
>
> Attachments: field-collapsing.patch, SOLR-1682.patch,
> SOLR-1682.patch, SOLR-1682.patch, SOLR-1682_prototype.patch,
> SOLR-1682_prototype.patch, SOLR-1682_prototype.patch, SOLR-236.patch
>
>
> Child issue of SOLR-236. This issue is dedicated to field collapsing in
> general and all its code (CollapseComponent, DocumentCollapsers and
> CollapseCollectors). The main goal is the finalize the request parameters and
> response format.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]