You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Jason Rutherglen <ja...@gmail.com> on 2012/03/07 07:03:59 UTC

Plans to add functions to results of groups

Are there plans to add the ability to apply functions (eg, sum,
average, distinct, or custom functions) to group'd documents.  Such
that the document list per group is not returned, instead the result
of the function is.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Plans to add functions to results of groups

Posted by Jason Rutherglen <ja...@gmail.com>.
It is a fairly typical use case due to the availability of aggregation
functions in combination with GROUP BY in SQL. Conceptually, given the
work that has already been completed with Lucene's group by
functionality these may be simple add ons.

A couple of features that would effectively duplicate SQL GROUP BY:

1. Group by multiple fields (eg, combine per doc fields into one
unique key and group by the key)
2. Aggregation functions on a single field.  These can be implemented
as an interface that evaluates each per group document, and outputs a
final value.  COUNT, COUNT DISTINCT, AVG, return a single numeric
values.

Thanks for pointing out LUCENE-3444, that is a great direction.

On Wed, Mar 7, 2012 at 5:06 PM, Martijn v Groningen
<ma...@gmail.com> wrote:
> I haven't seen an issue describing this. Something like this was available
> in the SOLR-236 patches, but never got committed.
> I started to create a second pass collector that counts the distinct values
> of a particular field for the top N groups in LUCENE-3444.
>
> I think there might be a need for a more general approach for this kind of
> functionality that uses the ValueSource concept in the queries module.
>
> Martijn
>
> On 7 March 2012 07:03, Jason Rutherglen <ja...@gmail.com> wrote:
>>
>> Are there plans to add the ability to apply functions (eg, sum,
>> average, distinct, or custom functions) to group'd documents.  Such
>> that the document list per group is not returned, instead the result
>> of the function is.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>
>
>
> --
> Met vriendelijke groet,
>
> Martijn van Groningen

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Plans to add functions to results of groups

Posted by Martijn v Groningen <ma...@gmail.com>.
I haven't seen an issue describing this. Something like this was available
in the SOLR-236 patches, but never got committed.
I started to create a second pass collector that counts the distinct values
of a particular field for the top N groups in LUCENE-3444.

I think there might be a need for a more general approach for this kind of
functionality that uses the ValueSource concept in the queries module.

Martijn

On 7 March 2012 07:03, Jason Rutherglen <ja...@gmail.com> wrote:

> Are there plans to add the ability to apply functions (eg, sum,
> average, distinct, or custom functions) to group'd documents.  Such
> that the document list per group is not returned, instead the result
> of the function is.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>


-- 
Met vriendelijke groet,

Martijn van Groningen