要在 Solr 中索引日期,日期应采用 ISO 格式。
我们可以在不修改 SQL Select 语句的情况下索引 MySQL Timestamp 或 Date Time 字段吗?
我用过
<fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
<field name="CreatedDate" type="tdate" indexed="true" stored="true" />
CreatedDate is of Type Date Time in MySQL
我收到以下异常
11:23:39,117 WARN [org.apache.solr.handler.dataimport.DateFormatTransformer] (Thread- 72) Could not parse a Date field : java.text.ParseException: Unparseable date: "2013-04-14 11:22:48.0"
非常感谢解决此问题的任何帮助
检查 SOLR 中日期时间字段的默认性质
日期字段SOLR http://lucene.apache.org/solr/4_6_0/solr-core/org/apache/solr/schema/DateField.html
使用以下 mysql 函数转换您的日期时间值
SELECT id,DATE_FORMAT(created_at,'%Y-%m-%dT%TZ') as created_at,... from table
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)