lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <li...@ehatchersolutions.com>
Subject DateField bug?
Date Tue, 17 Dec 2002 01:23:14 GMT
Before I enter this into Bugzilla, I thought I'd get a sanity check 
here.  I'm using DateField and indexing it like this:

   doc.add(Field.Keyword("modified",
           DateField.timeToString(file.lastModified())));

(I'm not using the Date variant of the Keyword method).

It indexes fine, but on retrieval, I'm doing this:

   long time = DateField.stringToTime(indexModified);

And this is dying with this:

java.lang.NumberFormatException:  d968b5t4
         at java.lang.Long.parseLong(Long.java:310)
         at org.apache.lucene.document.DateField.stringToTime(Unknown 
Source)

This is occuring in 1.3-dev1 build, but not in the 1.2 build.

I checked a few sources in Lucene's CVS, but didn't spot anything with 
relevant changes.  But something is fishy somewhere.  Can anyone spot 
anything I'm doing wrong or offer any clues?

Also, the Field.Keyword(String, Date) method is setting the field to be 
tokenized - is this appropriate?  The Field.Keyword(String, String) does 
not set that flag.

Thanks,
	Erik


--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message