You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2008/04/21 21:13:22 UTC
[jira] Commented: (SOLR-470) DateField throws error on iso8601 date
[ https://issues.apache.org/jira/browse/SOLR-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591001#action_12591001 ]
Hoss Man commented on SOLR-470:
-------------------------------
Paul: there are a few things that concern me about your patch...
* it isn't back compatible (changes the sig of getThreadLocalDateFormat)
* it doesn't address the root problem. The issue isn't Z or no Z, it's millis or no millis (SimpleDateFormat.parse will happily ignore extra stuff at end of string if it's not in the format, so specifying the Z isn't needed) ... what is needed is a parser that doesn't require the millis -- which you have, but drawing the distinction between Z and not Z isn't correct.
* it doesn't really work: toObject is always called on the *indexed* form which never has a Z at the end, so your new DateFormat isn't used ... and you'll still get an error if a date without millis is in the index.
> DateField throws error on iso8601 date
> --------------------------------------
>
> Key: SOLR-470
> URL: https://issues.apache.org/jira/browse/SOLR-470
> Project: Solr
> Issue Type: Bug
> Components: search
> Affects Versions: 1.3
> Reporter: patrick o'leary
> Assignee: Hoss Man
> Fix For: 1.3
>
> Attachments: SOLR-470.patch
>
>
> A correct iso 8601 date 2006-01-01T12:01:00Z throws an error.
> Unparseable date: "2006-01-01T12:01:00Z" at org.apache.solr.schema.DateField.toObject(DateField.java:173) at org.apache.solr.schema.DateField.toObject(DateField.java:83)
> The ThreadLocalDateFormat requires fractional seconds "yyyy-MM-dd'T'HH:mm:ss.SSS"
> to parse with simple date format. Where as the jdoc states their optional.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.