Hello,

You could try taking advantage of Solr's facetization feature : provided
that you have the amount stored in the amount field and the currency stored
in the currency field, try the following request :
http://host:port
/solr/select?q=YOUR_QUERY&stats=on&stats.field=amount&f.amount.stats.facet=currency&rows=0

You'll get a top-level stats node with false numbers, because of the mixed
currencies, but after that, you'll have one stat node per currency.

Alternatively, you could try indexing different currencies in seperate
fields (e.g. amount_usd, amount_eur, ...) and send your queries that way :

http://host:portsolr
/select?q=amount_us:*+OR+amount_eur:*[+OR+amount_...:*]&stats=on&stats.field=amount_usd&stats.field=amount_eur[&stats.field=amount_...]&rows=0
That way in one query you'll get everything you want, excepted that you
can't trust "missing" count for each sum computed. May be your query isn't a
"select all" one, I which case you should get results even faster.

Hope that helps a little...

--
Tanguy

2011/1/10 stockii <st...@shopgate.com>

>
> Hello.
>
> i`m using the StatsComponent to get the sum of amounts. but solr
> statscomponent is very slow on a huge index of 30 Million documents. how
> can
> i tune the statscomponent ?
>
> the problem is, that i have 5 currencys and i need to send for each
> currency
> a new request. thats make the solr search sometimes very slow. =(
>
> any ideas ?
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Tuning-StatsComponent-tp2225809p2225809.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to