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

Mark Desira edited comment on SOLR-2898 at 1/6/12 8:32 AM:
-----------------------------------------------------------

Hi I am new to SOLR and was looking for (what seems to be) the function/patch 
in question.

My scenario is this:

ID :    ProductName :           ProductCategory :       Colour
---------------------------------------------------
1 :     BatmanTShirt :          T-Shirt :               Black
2 :     BatmanTShirt :          T-Shirt :               Blue
3 :     SupermanTShirt :        T-Shirt :               Blue
4 :     SpidermanTrousers :     Trousers :              Red
5 :     SpidermanTrousers :     Trousers :              Black

If I use the usual faceting (on ProductCategory) in SOLR, I would get the 
following results:

T-Shirt (3)
Trousers (2)

However what I want the facets to look like is the following:

T-Shirt (2)
Trousers (1)

Meaning that I don't want the colour to generate (3) counts for T-Shirt and (2) 
counts for Trousers.
I know that I can 'normalize' the document to hold multi-valued field for the 
colours however that would complicate my system a bit because I have other 
fields (such as 'Price' and 'Size') to include in the multi-valued field.

What I would like to do is to sort of GROUP BY ProductName and ProductCategory, 
this would 'flatten' the rows to just 3; (2) for T-Shirt and (1) for Trousers; 
and then I apply the facet, resulting in what I require

>From what I'm understanding, this patch would work great for me am I right?
If so, could you point me to some tutorial on how can I apply this patch?

Thanks.

P.S. Sorry for issuing multiple edits for this comment but I was attempting to 
make the 'Table' text monospaced, sadly without any success. (As you can see 
I'm new to wikis as well)
                
      was (Author: mrd3650):
    Hi I am new to SOLR and was looking for (what seems to be) the 
function/patch in question.

My scenario is this:

{{ID :  ProductName :                   ProductCategory :       Colour}}
---------------------------------------------------
1 :     BatmanTShirt :          T-Shirt :                       Black
2 :     BatmanTShirt :          T-Shirt :                       Blu
3 :     SupermanTShirt :        T-Shirt :                       Blue
4 :     SpidermanTrousers :     Trousers :              Red
5 :     SpidermanTrousers :     Trousers :              Black}}

If I use the usual faceting (on ProductCategory) in SOLR, I would get the 
following results:

T-Shirt (3)
Trousers (2)

However what I want the facets to look like is the following:

T-Shirt (2)
Trousers (1)

Meaning that I don't want the colour to generate (3) counts for T-Shirt and (2) 
counts for Trousers.
I know that I can 'normalize' the document to hold multi-valued field for the 
colours however that would complicate my system a bit because I have other 
fields (such as 'Price' and 'Size') to include in the multi-valued field.

What I would like to do is to sort of GROUP BY ProductName and ProductCategory, 
this would 'flatten' the rows to just 3; (2) for T-Shirt and (1) for Trousers; 
and then I apply the facet, resulting in what I require.

>From what I'm understanding, this patch would work great for me am I right?
If so, could you point me to some tutorial on how can I apply this patch?

Thanks.
                  
> Support grouped faceting
> ------------------------
>
>                 Key: SOLR-2898
>                 URL: https://issues.apache.org/jira/browse/SOLR-2898
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Martijn van Groningen
>         Attachments: SOLR-2898.patch
>
>
> Support grouped faceting. As described in LUCENE-3097 (matrix counts).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to