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 "cmd.ares" <cm...@gmail.com> on 2012/12/14 06:16:12 UTC

facet count distinct and sum group by field

lucene index structure: 
product_name       type              price 
----------------------------------------------- 
iphone4s              mobile         2000 
iphone4s              mobile         1500 
iphone5               mobile         5000 
iphone5               mobile         5000 
S3                      mobile         3000 
intel i3                 pc              1000 
intel i5                 pc              1500 
------------------------------------------------ 
i want to use solr like sql: 
select type,count(distinct product_name)s1,sum(price)s2 group by type 
how to do it with solr? 
thanks



--
View this message in context: http://lucene.472066.n3.nabble.com/facet-count-distinct-and-sum-group-by-field-tp4026931.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: facet count distinct and sum group by field

Posted by "cmd.ares" <cm...@gmail.com>.
Can't seem to support



--
View this message in context: http://lucene.472066.n3.nabble.com/facet-count-distinct-and-sum-group-by-field-tp4026931p4029377.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: facet count distinct and sum group by field

Posted by frank shi <fi...@gmail.com>.
i think you should use group,stats



--
View this message in context: http://lucene.472066.n3.nabble.com/facet-count-distinct-and-sum-group-by-field-tp4026931p4134609.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: facet count distinct and sum group by field

Posted by Fredrik Rødland <so...@rodland.no>.
Den 14. des. 2012 kl. 06:16 skrev cmd.ares:

> i want to use solr like sql: 
> select type,count(distinct product_name)s1,sum(price)s2 group by type 
> how to do it with solr? 
> thanks

I think you should be able to do this using the StatsComponent faceting on type

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

Regards,

Fredrik