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 Jens Fischer <je...@hour1.de> on 2009/06/05 10:50:56 UTC

Customize facet.method

Hi,

 

What is the best way to do some customized calculations on fields of the
full result set?

Each result contains a couple of numerical values.

First I need to do a calculation for every single result and send build the
average over the resulting numbers.

I thought about using FacetSearch but am not sure if it can be customized
that way.

Any suggestions?

 

Thanks

Jens


Re: Customize facet.method

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Jun 5, 2009 at 2:20 PM, Jens Fischer <je...@hour1.de> wrote:

>
> What is the best way to do some customized calculations on fields of the
> full result set?
>
> Each result contains a couple of numerical values.
>
> First I need to do a calculation for every single result and send build the
> average over the resulting numbers.
>

For simply calculating averages StatsComponent can be used

http://wiki.apache.org/solr/StatsComponent

However, since you need to do some calculations, I think you can write a
custom FunctionQuery/ValueSourceParser to do the job.

-- 
Regards,
Shalin Shekhar Mangar.