格式化Solr日期分面参数

时间:2017-09-13 13:58:44

标签: apache solr facet solrnet

以下是用于查看观察时间的方面的Solr。

http://localhost:8983/solr/corearticle/select?indent=on&q=viewtime:*&facet=true&facet.field=viewtime&facet.date=viewtime&facet.date.start=NOW/DAY-30DAYS&facet.date.end=NOW/DAY+30DAYS&facet.date.gap=+1DAY

以下是结果:

<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields">
<lst name="viewtime">
<int name="2016-09-14T16:13:26Z">1</int>
<int name="2016-10-26T09:16:36Z">1</int>
<int name="2016-10-26T09:32:00Z">1</int>
<int name="2016-10-26T09:32:16Z">1</int>
<int name="2017-09-02T15:23:24Z">1</int>
<int name="2017-09-03T15:23:32Z">1</int>
<int name="2017-09-03T18:42:27Z">1</int>
<int name="2017-09-07T11:29:31Z">1</int>
<int name="2017-09-12T16:49:48Z">1</int>
<int name="2017-09-12T16:50:21Z">1</int>
<int name="2017-09-12T16:50:39Z">1</int>
<int name="2017-09-12T16:50:54Z">1</int>
<int name="2017-09-12T16:51:08Z">1</int>
<int name="2017-09-12T16:51:17Z">1</int>
<int name="2017-09-12T17:10:32Z">1</int>
<int name="2017-09-12T17:16:38Z">1</int>
<int name="2017-09-12T17:29:24Z">1</int>
<int name="2017-09-12T17:30:31Z">1</int>
<int name="2017-09-12T17:30:41Z">1</int>
<int name="2017-09-12T17:30:49Z">1</int>
<int name="2017-09-13T11:33:18Z">1</int>
<int name="2017-09-13T11:33:29Z">1</int>
<int name="2017-09-13T11:42:59Z">1</int>
<int name="2017-09-13T11:43:17Z">1</int>
<int name="2017-09-13T11:43:46Z">1</int>
<int name="2017-09-13T11:55:05Z">1</int>
<int name="2017-09-13T11:55:29Z">1</int>
<int name="2017-09-13T12:15:18Z">1</int>
<int name="2017-09-13T12:20:49Z">1</int>
<int name="2017-09-13T12:21:18Z">1</int>
<int name="2017-09-13T12:26:21Z">1</int>
<int name="2017-09-13T15:57:01Z">1</int>
<int name="2017-09-13T16:01:20Z">1</int>
<int name="2017-09-13T16:01:59Z">1</int>
<int name="2017-09-13T16:02:03Z">1</int>
<int name="2017-09-13T16:02:06Z">1</int>
<int name="2017-09-13T16:31:35Z">1</int>
<int name="2017-09-13T16:41:41Z">1</int>
<int name="2017-09-13T16:43:28Z">1</int>
<int name="2017-09-13T17:10:21Z">1</int>
<int name="2017-09-13T17:10:47Z">1</int>
</lst>
</lst>
<lst name="facet_ranges"/>
<lst name="facet_intervals"/>
<lst name="facet_heatmaps"/>
</lst>

但是这默认返回yyyy-MM-ddTHH:mm:ssZ格式。我需要根据yyyy-MM-dd格式进行分组。

1 个答案:

答案 0 :(得分:0)

无法更改,因为使用的日期格式是dateTime的规范表示的限制形式,如此处所述Working with Dates