You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by ma...@thomsonreuters.com on 2011/07/06 18:37:55 UTC

StreamingUpdateSolrServer Indexing dates

Hi All

 

I'm indexing a set of xml documents using StreamingUpdateSolrServer but
I'm having trouble indexing dates.

 

I get an error like:

 

SEVERE: error

java.lang.Exception: Invalid Date Math String:'2011-04-22T05:35:37Z
'

 

Invalid Date Math String:'2011-04-22T05:35:37Z     '

 

I notice the trailing spaces but in my document they are not present:

 

<maindocdate_dt><![CDATA[2011-04-22T05:35:37Z]]></maindocdate_dt>

 

I am adding the field to the document with:

 

document.addField(element, sb); //sb is a string

 

 

 

I am using the schema supplied with the example as follows but still no
joy.

 

<fieldType name="tdate" class="solr.TrieDateField" omitNorms="true"
precisionStep="6" positionIncrementGap="0"/>

<dynamicField name="*_dt" type="tdate"    indexed="true"
stored="true"/>

 

Any suggestions, thank you,

 

Matt


This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.

Re: StreamingUpdateSolrServer Indexing dates

Posted by Chris Hostetter <ho...@fucit.org>.
: Invalid Date Math String:'2011-04-22T05:35:37Z     '
	...
: I notice the trailing spaces but in my document they are not present:
	...
: <maindocdate_dt><![CDATA[2011-04-22T05:35:37Z]]></maindocdate_dt>
	...
: I am adding the field to the document with:
	...
: document.addField(element, sb); //sb is a string

There is at least one step missing in your process -- the XML you showed 
us isn't the Solr XML Message format, so it can't be the poutput 
of using the StreamingUpdateSolrServer after you build up 
SOlrInputDocuments.

i suspect you have some code that parses your XML, and in that code you 
call document.addField ... have you verified in that parsing/building code 
exactly what's going on and what the value of "sb" is (ie: via debugger)

	?

-Hoss