【发布时间】:2018-08-15 15:52:14
【问题描述】:
在我的数据库中,日期类似于1973-01。它们存储为字符串值。如果我必须使用 Apache Solr 对此进行索引,那么我该怎么做。
我在我的 schema.xml 中写了以下内容:
<field name="pubdate" type="tdate" indexed="true" stored="true" multiValued="false" />
我还更改了所有日期,例如1973-01Z。但我仍然收到错误消息:
org.apache.solr.common.SolrException: Invalid Date in Date Math String:'1973-01Z'
我相信 Solr 只接受像 1995-12-31T23:59:59Z 这样的日期
谁能帮忙?
【问题讨论】:
-
你也可以使用
string类型而不是tdate -
如果我这样做了,我可以根据日期进行搜索或排序吗? @HectorCorrea
标签: search indexing solr lucene solrj