Can the default value in a field in a Solr schema be the current date?

I am using Solr and I would like to add the last_update field in schema.xml where the default is the current date when the document is added or updated.

Do you have an idea how I can do this?

thanks

+9
source share
1 answer

This is a supported script for DateField . The following should work:

 <field name="last_update" type="date" indexed="true" stored="true" default="NOW" /> 
+20
source

All Articles