lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zheng Lin Edwin Yeo <edwinye...@gmail.com>
Subject Re: Sum of all values in Function Query
Date Thu, 04 Aug 2016 06:50:54 GMT
Hi Mikhail,

Yes, I have tried this, and it works for individual fields.

Currently I am trying to do something like sum(product(Quanity,Amount). Is
is possible to do it in a single Solr query?

Regards,
Edwin



On 3 August 2016 at 16:35, Mikhail Khludnev <mkhl@apache.org> wrote:

> Edwin,
> Did you try something from http://yonik.com/solr-facet-functions/ ?
>
> On Wed, Aug 3, 2016 at 6:58 AM, Zheng Lin Edwin Yeo <edwinyeozl@gmail.com>
> wrote:
>
> > Hi,
> >
> > Would like to find out, is it possible for Solr to find a sum of all the
> > values that are returned in a query?
> >
> > For example, when I does a search in which that is a field called
> "Amount"
> > with fieldType=float.
> > Is it possible for Solr to do return the sum of all the "Amount" that are
> > returned? If the main search query is *:*, then it should return the sum
> of
> > all the "Amount" that are present in the entire collection.
> >
> > i have tried to use sum(Amount), but this doesn't work, as I believe what
> > the sum does is to just do the sum of the static amount in each of the
> > individual record, and not the entire search field records.
> >
> > I'm using Solr 6.1.0
> >
> > Regards,
> > Edwin
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message