lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Andersson <dan...@polkabrothers.com>
Subject Re: Unparseable date
Date Wed, 05 Mar 2008 22:01:44 GMT
On Mar 5, 2008, at 10:57 PM, Chris Hostetter wrote:

> : looking at the current code for DateField.toObject(Fieldable) it  
> seems
> : inheriently broken, attempting to parse a string right after  
> concating 'Z'
> : on the end even though the parser expects the Z to already be  
> gone -- i'm
> : not sure how this could path could *ever* work, regardless of the  
> input.
>
> Duh, i forgot a key aspect of DateFormat.parse(String): "The method  
> may
> not use the entire text of the given string." ... which is why the  
> code
> can work sometimes, the parser will happily ignore the 'Z' ... the
> exception is about the fact that there are no milliseconds (which are
> suppose to be optional)
>
> so this really is the exact same bug as SOLR-470 ... the problem is  
> just
> more significant then i thought -- I assumed the only way to  
> trigger this
> was a DateMath expression that didn't have milliseconds, but
> DateField.toObject(Fieldable) has the same bug so direct usage of  
> it (by
> code like DocumentBuilder.loadStoredFields) will also cause this  
> problem
> if the orriginal date didn't have any milliseconds.

So if I add :00 to every time, it should be fine?
ie
"2008-02-12T15:02:06:00Z" instead of "2008-02-12T15:02:06Z"

Cheers,
Daniel

Mime
View raw message