You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Branca Marco <m....@reply.it> on 2009/04/28 16:48:01 UTC

Faceting - grouping results

Hi,
I have a question about faceting.
I'm trying to retrieve results grouped by a certain field. I know that I can specify the parameter "rows" in order to ask Solr to return only "rows" documents.
What I would like to do is to ask Solr to return a certain number of documents for each category found in the faceting info.
For example, calling the URL

 http://[server-ip]:[server-port]/select?q=*:*&facet=on&facet.field=xxx[&SOMETHING_ELSE]

on a set of indexed documents where xxx can assume the following values:
 - A
 - B
 - C

I would like to know what to set in the Solr URL in order to obtain, for instance:
 - at most 10 docs with xxx=A
 - at most 10 docs with xxx=B
 - at most 10 docs with xxx=C

Thank you for your help,

Marco Branca
Consultant Sytel Reply S.r.l.
Via Ripamonti,  89 - 20139 Milano
Mobile: (+39) 348 2298186
e-mail: m.branca@reply.it
Website: www.reply.eu

--
The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

Re: Faceting - grouping results

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
I'm not sure this is what you are looking for, but you may try to use
fq parameter? &q=*:*&fq=xxx:A&rows=10 for "at most 10 docs with xxx=A".

http://wiki.apache.org/solr/CommonQueryParameters#head-6522ef80f22d0e50d2f12ec487758577506d6002

Koji


Branca Marco wrote:
> Hi,
> I have a question about faceting.
> I'm trying to retrieve results grouped by a certain field. I know that I can specify the parameter "rows" in order to ask Solr to return only "rows" documents.
> What I would like to do is to ask Solr to return a certain number of documents for each category found in the faceting info.
> For example, calling the URL
>
>  http://[server-ip]:[server-port]/select?q=*:*&facet=on&facet.field=xxx[&SOMETHING_ELSE]
>
> on a set of indexed documents where xxx can assume the following values:
>  - A
>  - B
>  - C
>
> I would like to know what to set in the Solr URL in order to obtain, for instance:
>  - at most 10 docs with xxx=A
>  - at most 10 docs with xxx=B
>  - at most 10 docs with xxx=C
>
> Thank you for your help,
>
> Marco Branca
> Consultant Sytel Reply S.r.l.
> Via Ripamonti,  89 - 20139 Milano
> Mobile: (+39) 348 2298186
> e-mail: m.branca@reply.it
> Website: www.reply.eu
>
> --
> The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
>
>