AnsweredAssumed Answered

Solr cannot index dates

Question asked by anghelutar on Feb 4, 2013
Latest reply on Feb 17, 2013 by jego

I am trying to index the fields which have type d_datetime as proper date fields (type "date" or "tdate") in Solr. For this, I have added the type and the field in schema.xml:

fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true"
field name="@{}purchase_date" type="tdate" indexed="true" stored="true"

However, they are not indexed and the message in the log are:

WARNING: Node index failed and skipped for 861 in Tx 46
org.apache.solr.common.SolrException: Invalid Date String:'2013-02-01T19:26:54.000+01:00'
        at org.apache.solr.schema.DateField.parseMath(
        at org.apache.solr.schema.TrieDateField.createField(
        at org.apache.solr.schema.SchemaField.createField(
        at org.alfresco.solr.tracker.CoreTracker.toDocument(
        at org.alfresco.solr.tracker.CoreTracker.indexNode(
        at org.alfresco.solr.tracker.MultiThreadedCoreTracker$NodeIndexWorkerRunnable.doWork(
        at org.alfresco.solr.tracker.MultiThreadedCoreTracker$
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
        at java.util.concurrent.ThreadPoolExecutor$

I think this is because Solr only understands UTC dates. Is there any way to convert Alfresco's dates to UTC?