Solr Date Field Format

I am a little confused in the correct format for the solr date type field. When importing from mySQL database, should it be in this format?

1995-12-31T23:59:59Z 

In my database, the date and time fields are in different columns. Right now my request is as follows.

 SELECT eb.eventID, concat(CAST(e.startDate AS CHAR),'T ',CAST(e.startTime as CHAR),'Z') 

Am I on the right track?

+6
source share
1 answer

Yes, it should be in this format if you use the Solr type "DateField": http://lucene.apache.org/solr/api/org/apache/solr/schema/DateField.html

I don’t know how to format dates correctly in MySQL, but you want to make sure that the date is in yyyy-mm-dd format and the time is in HH: mi: ss format.

+8
source

Source: https://habr.com/ru/post/909571/


All Articles