lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: How to search document for modified date
Date Sat, 20 Sep 2003 13:11:36 GMT
On Saturday, September 20, 2003, at 07:38  AM, Senthil Kumar K wrote:
> Hi,
>
>     How to make query to search in the lucene index
> for document with specified date.While indexing
> i made
>  doc.add(Field.Keyword("modified",
> DateField.timeToString(f.lastModified())))
> like this.
>
> If any one knows how to search for documents with specific date.
> please give me a sample query.

Query query = new TermQuery(new Term("modified", 
DateField.dateToString(date));

You could also do this with QueryParser expressions, although there are 
some caveats to date fields and its usage (must use default locale 
short date format strings, for instance).

	Erik


Mime
View raw message