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 Bruno <br...@gmail.com> on 2009/12/04 19:08:59 UTC

Grouping

Is there a way to make a group by or distinct query?

-- 
Bruno Morelli Vargas
Mail: brunomv@gmail.com
Msn: brunom_@hotmail.com
Icq: 165055101
Skype: morellibmv

Re: Grouping

Posted by Martijn v Groningen <ma...@gmail.com>.
Field collapsing has some aggregation functions like sum() and avg(),
but the statistics are computed based on collapse groups instead of
all documents with the same field value. A collapse group contains
documents that were not relevant enough to end up (collapsed
documents) in the search result and one or more documents that are
relevant for the current search result, that are being displayed in
the search result. This number is controlled by the collapse.threshold
parameter, that defaults to one.

The statistics are calculated based on the collapsed documents, so it
is not exactly the same as a sql group by. You can however get similar
results when the collapse.threshold is one and add the field value
(e.g. price) of the most relevant document to the aggregated
statistic. Off course you will have to this yourself on the client
side. Hope this clarifies the field collapse functionality a bit.

Martijn

2009/12/4 Otis Gospodnetic <ot...@yahoo.com>:
> Not out of the box.  You could "group by" using SOLR-236 perhaps?
>
> Otis
> --
> Sematext -- http://sematext.com/ -- Solr - Lucene - Nutch
>
>
>
> ----- Original Message ----
>> From: Bruno <br...@gmail.com>
>> To: solr-user@lucene.apache.org
>> Sent: Fri, December 4, 2009 1:08:59 PM
>> Subject: Grouping
>>
>> Is there a way to make a group by or distinct query?
>>
>> --
>> Bruno Morelli Vargas
>> Mail: brunomv@gmail.com
>> Msn: brunom_@hotmail.com
>> Icq: 165055101
>> Skype: morellibmv
>
>

Re: Grouping

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Not out of the box.  You could "group by" using SOLR-236 perhaps?

Otis
--
Sematext -- http://sematext.com/ -- Solr - Lucene - Nutch



----- Original Message ----
> From: Bruno <br...@gmail.com>
> To: solr-user@lucene.apache.org
> Sent: Fri, December 4, 2009 1:08:59 PM
> Subject: Grouping
> 
> Is there a way to make a group by or distinct query?
> 
> -- 
> Bruno Morelli Vargas
> Mail: brunomv@gmail.com
> Msn: brunom_@hotmail.com
> Icq: 165055101
> Skype: morellibmv