How to change defaults.last_index_time format in solr

我与影子孤独终老i 提交于 2020-01-05 04:52:45

问题


I am using Apache Solr 6.2, and need a timestamp for defaults.last_index_time field or need separate field for a Core config.

Default value was defaults.last_index_time=2016-09-19 14:55:17 .

I need something like

defaults.last_index_time=1474297085558

回答1:


Use Property Writer to change last_index_time format in solr.Add the element to the DIH configuration file, directly under the dataConfig element

<propertyWriter dateFormat="yyyy-MM-dd'T'HH:mm:ss.SSSXXX" type="SimplePropertiesWriter"  />

In Property Writer you can specify your desired format. But as it seems you want date in milliseconds. As there is no dateFormat available for that.



来源:https://stackoverflow.com/questions/39576281/how-to-change-defaults-last-index-time-format-in-solr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!