lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Senthil Kumar K" <senthilkuma...@trigent.com>
Subject RE: How to search document for modified date
Date Sun, 21 Sep 2003 09:38:46 GMT
Hi,

  Erik thanks for your reply. 
  How to do using QueryParser expressions.

senthilkumar.k


-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com]
Sent: Saturday, September 20, 2003 6:42 PM
To: Lucene Users List
Subject: Re: How to search document for modified date


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


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org

Mime
View raw message