Mysql Solr索引我的SQL时间戳或日期时间字段
要在Solr中索引日期,日期应为ISO格式。 我们可以在不修改SQL Select语句的情况下索引MySQL时间戳或日期时间字段吗 我用过Mysql Solr索引我的SQL时间戳或日期时间字段,mysql,datetime,solr,dataimporthandler,Mysql,Datetime,Solr,Dataimporthandler,要在Solr中索引日期,日期应为ISO格式。 我们可以在不修改SQL Select语句的情况下索引MySQL时间戳或日期时间字段吗 我用过 <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/> <field name="CreatedDate" type="tdate" indexed="tru
<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
非常感谢您对解决此问题的任何帮助检查SOLR中datetime字段的默认性质 使用以下mysql函数转换日期时间值
SELECT id,DATE_FORMAT(created_at,'%Y-%m-%dT%TZ') as created_at,... from table
非常感谢。它起了神奇的作用。我花了太多时间来找出解析异常。即使使用DateFormatTransformer也不能解决我的问题。读了你的解决方案后,我想我为什么没有想到这个。非常感谢
SELECT id,DATE_FORMAT(created_at,'%Y-%m-%dT%TZ') as created_at,... from table