如何对Solr中的组进行求和? [英] How to sum groups in Solr?

查看:177
本文介绍了如何对Solr中的组进行求和?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  select sum(col1)group by Col2,Col3 

我想知道如何做到这一点像sql在solr?

我可以通过Col2来解决问题,例如 select sum(Col1) / code> in solr。( http://wiki.apache.org/solr/StatsComponent
你能帮助我吗?

解决方案

Solr提供了一个名为字段折叠

这将允许您在非多值字段上进行分组。


I want to know how to do this like sql in solr ?

select sum(Col1) group by Col2,Col3

I could solve the problem like select sum(Col1) group by Col2 in solr .( http://wiki.apache.org/solr/StatsComponent) can you help me ?

解决方案

Solr provides an grouping feature called field Collapsing
This will allow you to group on a non multivalued field.

这篇关于如何对Solr中的组进行求和?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆