Grouping and performing statistics per group

2011-08-25 Thread Omri Cohen
Hi All, I want to group-by certain field and perform statistics per group on a certain field of my choice. For example, if I have the next documents in my collection: doc child-id 12353 /child-id weight 65 /weight gender male /gender /doc doc child-id 12353 /child-id weight 63 /weight gender

Re: Grouping and performing statistics per group

2011-08-25 Thread Sowmya V.B.
Hi Is it possible that Luke Handler can be used for this? I used Something like: http://localhost:8080/solr/admin/luke?fl=fieldNamenumTerms=1 to get an estimate of a range of values a field can have. Hope you find this information useful. Sowmya. On Thu, Aug 25, 2011 at 10:58 AM, Omri

Re: Grouping and performing statistics per group

2011-08-25 Thread Omri Cohen
Thanks, but I actually need something more deterministic and more accurate.. Anyone knows if there is an already existing feature for that? thanks again

Re: Grouping and performing statistics per group

2011-08-25 Thread Martijn v Groningen
Hi Omri, I think you can achieve that with grouping and the Solr StatsComponent ( http://wiki.apache.org/solr/StatsComponent). In order to compute statistics on groups you must set the option group.truncate=true An example query:

Re: Grouping and performing statistics per group

2011-08-25 Thread Martijn v Groningen
Or if you dont care about grouped results you can also add the following option: stats.facet=gender On 25 August 2011 14:40, Martijn v Groningen martijn.v.gronin...@gmail.comwrote: Hi Omri, I think you can achieve that with grouping and the Solr StatsComponent (

Re: Grouping and performing statistics per group

2011-08-25 Thread Omri Cohen
Hi, thanks for your reply.. it doesn't work. I am getting the plain stats results at the end of the response, but no statistics per group.. thanks anyway

Re: Grouping and performing statistics per group

2011-08-25 Thread Martijn v Groningen
If you take this query from the wiki: http://localhost:8983/solr/select?q=*:*stats=truestats.field=pricestats.field=popularitystats.twopass=truerows=0indent=truestats.facet=inStock In this case you get stats about the popularity per inStock value (true / false). Replacing this values with weight