Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change date format in solr yyyy-mm-ddThh:mm:ssZ into " yyyy-mm-dd"?

I want to change default date format in solr "yyyy-mm-ddThh:mm:ssZ" into "yyyy-mm-dd". To change date format what is the file should change inside solr folder? Where and what is the configuration file which can configure date foramt?

like image 352
code8 Avatar asked Feb 13 '23 03:02

code8


1 Answers

The date format used is a restricted form of the canonical representation of dateTime in the XML Schema specification. You can not change the solr default date format.

And schema.xml is the file to configure the date field.

Example:

<field name="Date" datetimeformat="YYYY-MM-DD'T'HH:mm:sss'Z'" 
indexed="true" multivalued="false" stored='true' type="date"> </field>
like image 57
iLaYa ツ Avatar answered Apr 07 '23 19:04

iLaYa ツ