lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Date Field Indexing
Date Wed, 29 Mar 2006 17:56:26 GMT

On Mar 29, 2006, at 11:37 AM, Dennis Kubes wrote:
> Looking at the Lucene In Action book it shows indexing Date fields  
> with
> something like this:
> Field.Keyword("datefield", new Date());
> I know that the APIs have changed for Field and I see that there  
> are no
> longer date constructors. So just confirming that we should use the
> DateTools class and store dates as text to index?

That is correct.

I've upgraded the "Lucene in Action" codebase (locally, will release  
it when Lucene 2.0 ships) for the Lucene 2.0 API and here's what I  
did in the IndexBuilder class that used to use Field(String,Date):

       String now = DateTools.dateToString(timestamp.getTime(),  
       document.add(new Field("last-modified", now, Field.Store.YES,  


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message