I am upgrading an index from Solr 3.6 to 4.2.0.

Everything has been picked up except for the old DateFields.

I read some posts that due to the "extra functionality" of the TrieDateField 
you would need to re-index for those fields.

To avoid re-indexing I was trying to do a Partial Update 
(http://solr.pl/en/2012/07/09/solr-4-0-partial-documents-update/),

I am doing this with a Python script that does a query, pulls the field 
contents and then reformats it and sends a JSON update back to Solr.

But no matter what I send Solr gives me the same error

SEVERE: java.lang.ClassCastException: java.lang.String cannot be cast to 
java.util.Date
        at org.apache.solr.schema.TrieDateField.toObject(TrieDateField.java:70)
        at org.apache.solr.schema.TrieDateField.toObject(TrieDateField.java:55)
        ……

I have tried send the date as a date string to be parsed and as a number of 
milliseconds from or before epoch. Both give the same error.

Any suggestions would be appreciated.

Examples of record attempts.

As seconds
------------------------------
2014-06-19 16:02:09,503 - solr_date_fixer - DEBUG - old record -> 
{u'timestamp': 
u'ERROR:SCHEMA-INDEX-MISMATCH,stringValue=2013-07-17T18:09:59.049', u'PID': 
u'uofm:1235128'}
2014-06-19 16:02:09,503 - solr_date_fixer - DEBUG - new record -> {'timestamp': 
{'set': 1374084599049.0}, 'PID': u'uofm:1235128'}
------------------------------

As date
------------------------------
2014-06-20 08:11:27,986 - solr_date_fixer - DEBUG - old record -> 
{u'timestamp': 
u'ERROR:SCHEMA-INDEX-MISMATCH,stringValue=2013-07-17T18:09:59.049', u'PID': 
u'uofm:1235128'}
2014-06-20 08:11:27,986 - solr_date_fixer - DEBUG - new record -> {'timestamp': 
{'set': u'2013-07-17T18:09:59.049Z'}, 'PID': u'uofm:1235128'}
-------------------------------
--
Jared Whiklo
Developer – Digital Initiatives
University of Manitoba Libraries
v: 204-474-6523
c: 204-228-1943
e: jared_whi...@umanitoba.ca

Reply via email to