简体   繁体   English

Solr搜索中的日期格式

[英]Date Formatting In Solr Search

I am inserting date in this format into Solr - (2015-11-10T10:24:53+00:00), but when I fire a search query, it returns the results in this format - (2015-11-0T10:24:53Z). 我正在将这种格式的日期插入Solr-(2015-11-10T10:24:53 + 00:00),但是当我触发搜索查询时,它将以这种格式返回结果-(2015-11-0T10:24 :53Z)。

How can I get the date in exactly the format I inserted in? 如何以完全插入的格式获取日期?

Solr does not have any concept of time zones, and UTC (2015-11-10T10:24:53Z) is the only format supported. Solr没有任何时区概念,并且UTC(2015-11-10T10:24:53Z)是唯一受支持的格式。

You'll have to convert on the way out in your display layer and when indexing (if they're both identical and you don't have to consider time zones, you can just pretend they're UTC to Solr). 您必须在显示层和索引编制时进行转换(如果它们都是相同的,并且不必考虑时区,则可以假装它们是Solr的UTC)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM