[ 
https://issues.apache.org/jira/browse/SOLR-1351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754506#action_12754506
 ] 

Uri Boness commented on SOLR-1351:
----------------------------------

This is something that I've done in the far past (Solr 1.2) and they way I see 
it, facets should be identified by a unique idea rather than by the field name 
and the facet results will then be grouped by these ids. I think this can be 
done by just adding one extra parameter in the form: 

{code}
f.<fieldName>.facet.id
{code}

This parameter will practically mean that all other specific parameter for 
field facet will need to use this id instead of the field name, that is:

Assuming we have a field called "cat" to represent a category. Right now 
(without an id) we ca do:

{code}
q=*:*&facet=true&facet.field=cat&f.cat.facet.sort=true&f.cat.facet.limit=20&f.cat.facet.mincount=1
{code}

with introducing the id:

{code}
q=*:*&facet=true&facet.field=cat&f.cat.facet.id=category&f.category.facet.sort=true&f.category.facet.limit=20&f.category.facet.mincount=1
{code}

Now to support multiple "configurations":

{code}
q=*:*&facet=true&facet.field=cat&f.cat.facet.id=cat1&f.cat1.facet.sort=true&f.cat1.facet.limit=20&f.cat1&facet.mincount=1&f.cat.facet.id=cat2&f.cat2.facet.sort=false&f.cat2.facet.count=0
{code}

Note that even after introducing the id param, backward compatibility can 
easily be maintained - we just determine that when the id param is not 
specified, the field name is the default id.

>From experience, I can tell you that adding this feature not only will enable 
>multiple facets on the same field, but IMO will also make it much easier to 
>develop search clients and tools on top of Solr.

If this solution sounds reasonable, I can start working on a patch for it.

> facet on same field different ways
> ----------------------------------
>
>                 Key: SOLR-1351
>                 URL: https://issues.apache.org/jira/browse/SOLR-1351
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Yonik Seeley
>             Fix For: 1.5
>
>
> There is a general need to facet on the same field in different ways 
> (different prefixes, different filters).  We need a way to express this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to