问题
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