码迷,mamicode.com
首页 > 其他好文 > 详细

Solr facet.date分组查询numFound结果数和docs结果数量不一致问题

时间:2015-06-03 11:38:08      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:

解决办法:

http://stackoverflow.com/questions/16935696/solr-facet-date-count-wrong

Tried date faceting in Solr 4.2.1 and it is not returning correct values. It has been deprecated like the wiki says. Instead I tried range faceting and it works fine:

q=*:*&wt=json&rows=0&facet=true&facet.range=PRESENTDATE&facet.range.start=2011-12-01T00:00:00Z&facet.range.end=2012-06-01T23:59:59Z&facet.range.gap=%2B1MONTH

出现问题的原因是solr版本问题,solr3.1以上版本需要使用facet.range代替facet.date

solr官方wiki也有提到:

https://wiki.apache.org/solr/SimpleFacetParameters#Date_Faceting_Parameters

When using Date Faceting, the facet.date, facet.date.start, facet.date.end, and facet.date.gap params are all mandatory...

NOTE: as of Solr3.1 Date Faceting has been deprecated in favor of the more general Range Faceting described below. The response structure is slightly different, but the functionality is equivalent (except that it supports numeric fields as well as dates)

 

Solr facet.date分组查询numFound结果数和docs结果数量不一致问题

标签:

原文地址:http://www.cnblogs.com/zhangjianzhi/p/4548425.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!