Maybe we do need to think more seriously about some of those higher-level SQL-like features.

Function queries, which can now be used as "pseudo-fields" in the "fl" parameter do have a "sum" function, but that merely adds an explicit list of functions/field names for a single document.

Maybe what we need is a separate parameter for such aggregate functions.

-- Jack Krupansky

-----Original Message----- From: Markus.Mirsberger
Sent: Monday, October 29, 2012 11:45 AM
To: solr-user@lucene.apache.org
Subject: Re: Is it possible to use something like sum() in a solr-query?

I have for example an integer field and want to sum all these values for
all the matching documents.

Similar to this in sql:

SELECT SUM(/expression/ )
FROM tables
WHERE predicates;


Regards,
Markus

On 29.10.2012 22:25, Jack Krupansky wrote:
Unfortunately, neither the subject nor your message says it all. Be
specific - what exactly do you want to sum? All matching docs? Just
the returned docs? By group? Or... what?

You can of course develop your own search component that does whatever
it wants with the search results.

-- Jack Krupansky

-----Original Message----- From: Markus.Mirsberger
Sent: Monday, October 29, 2012 11:08 AM
To: solr-user@lucene.apache.org
Subject: Is it possible to use something like sum() in a solr-query?

Hi,

the subject says it all :)
Is there something like sum() available in a solr query to sum all
values of a field ?

Regards,
Markus Mirsberger

Reply via email to