Expand my Community achievements bar.

Embedded SOLR : Throwing SolrException while indexing date fields

Avatar

Level 2

Hi,

We are using Embedded SOLR for indexing contents. We have successfully configured the data fields in schema.xml for custom metadata's. But we are facing issue when adding jcr:lastModified field and type as "date". SOLR is throwing the following stack trace,

Caused by: org.apache.solr.common.SolrException: Invalid Date String:'2016-01-25T16:12:56.518+05:30'
    at org.apache.solr.schema.DateField.parseMath(DateField.java:182)
    at org.apache.solr.schema.TrieField.createField(TrieField.java:621).

Related entries for date field in the schema.xml as follows,

Field Type definition for Date:

<fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>

jcr:lastModified Field definition:

<field name="jcr:lastModified" type="tdate" indexed="false" stored="true" docValues="true"/>

Please suggest us the possible way to index the date field in SOLR using embedded solr server.

3 Replies

Avatar

Level 9

In my view, Solr does not understand this date string format. Not yet very sure how to solve it, will try to find out. However, Here are few docs which could useful to you...

https://cwiki.apache.org/confluence/display/solr/Working+with+Dates

http://lucene.apache.org/solr/4_4_0/solr-core/org/apache/solr/schema/DateField.html

Jitendra

Avatar

Level 2

Thanks Jitendra.. The problem here is SOLR expects the date fields to be in UTC time format by default. Is there any way to convert the date format to UTC indexing in the embedded server? 

Avatar

Level 9

I really don't know if we could convert a date in another format in the embedded server. If it is external server, it might be in our hand to push the required format to the Solr server.

Need to find a way. 

Boobalan M wrote...

Thanks Jitendra.. The problem here is SOLR expects the date fields to be in UTC time format by default. Is there any way to convert the date format to UTC indexing in the embedded server?