I thought that that value was a perfectly valid one for ISO 9601 time?

http://en.wikipedia.org/wiki/Year_zero


 Dennis Gearon


Signature Warning
----------------
It is always a good idea to learn from your own mistakes. It is usually a 
better 
idea to learn from others’ mistakes, so you do not have to make them yourself. 
from 'http://blogs.techrepublic.com.com/security/?p=4501&tag=nl.e036'


EARTH has a Right To Life,
otherwise we all die.



----- Original Message ----
From: gwk <g...@eyefi.nl>
To: solr-user@lucene.apache.org
Sent: Wed, November 17, 2010 2:12:16 AM
Subject: Re: DateFormatTransformer issue with value 0000-00-00T00:00:00Z

On 11/16/2010 1:41 PM, Shanmugavel SRD wrote:
> Hi,
>     I am having a field as below in my feed.
> <field name="published_from_dt">0000-00-00T00:00:00Z</field>
>
>     I have configured the field as below in data-config.xml.
> <field column="published_from_dt"
> xpath="/add/doc/fie...@name='published_from_dt']"
> dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss'Z'" />
>
>     But after indexing, the field value becomes like this
> <date name="published_from_dt">0002-11-30T00:00:00Z</date>
>
>     I want to have the value as '0000-00-00T00:00:00Z' after indexing also.
> Could anyone help on this?
>
> PS: I am using solr 1.4.1
As 0000-00-00T00:00:00Z isn't a valid date I don't think the Solr's date 
field will accept it. Assuming this is MySQL you can use the 
zeroDateTimeBehavior connection string option, i.e. 
mysql://user:passw...@mysqlhost/database?zeroDateTimeBehavior=convertToNull
This will make the mysql driver return those values as NULL instead of 
all-zero dates.

Regards,

gwk

Reply via email to