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
<[email protected]> 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 <[email protected]> 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: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
>
>
> --
> Met vriendelijke groet,
>
> Martijn van Groningen

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

Reply via email to