Solr Facet Query

二次信任 提交于 2019-12-13 04:18:23

问题


I have a schema which has field Polarity which is of type "text" and has three values 0,1,-1 and CreatedAt which is of type "date".

How can I get count of each polarity based on dates. For example, it gives the output that on 5/1/2011 there were 10 counts of 0, 10 counts of 1 and 10 counts of -1


回答1:


Something like that ?

http://192.168.0.10:8080/solr/your_repository/select?q=date:20110105&facet=true&facet.limit=10&facet.field=Polarity




回答2:


A little late but may help others looking for an answer.

I would suggest check for Solr pivots for this kind of hierarchical faceting.
You can facet on the dates and the polarity as secondary facet to get results within the date.



来源:https://stackoverflow.com/questions/5935066/solr-facet-query

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!