开发者

Default value in a field in the Solr schema can be the current date?

开发者 https://www.devze.com 2023-04-02 12:08 出处:网络
I\'m using Solr and I would like to add a field last_u开发者_开发问答pdate in the schema.xml where the default value would be the current date when the document is added or updated.

I'm using Solr and I would like to add a field last_u开发者_开发问答pdate in the schema.xml where the default value would be the current date when the document is added or updated.

Do you have an idea how can I do this?

Thanks


It is a supported scenario for DateField. The following should work:

<field name="last_update" type="date" indexed="true" stored="true" default="NOW" />
0

精彩评论

暂无评论...
验证码 换一张
取 消