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: Problem with Date Range search
Date Fri, 14 Nov 2003 12:59:27 GMT
On Thursday, November 13, 2003, at 07:42  PM, Joseph Wilkicki wrote:
> I'm having a problem with searching dates.  I created two documents 
> with the
> same date, 08/27/2002, in a lastModified field and then try and search 
> a
> range lastModified:[20020827 TO 20020827] (Other, wider ranges, don't 
> seem
> to help).  My understanding is that this should return my two documents
> because the range is inclusive.  As a related aside, I can't seem to 
> get any
> range to work properly at all.  Here is a snippet of code describing 
> what
> I'm doing:

Dates require special considerations when dealing with QueryParser.  By 
default, you need to use the short format in the default locale for the 
expressions:

	lastModified:[08/27/2002 TO 08/27/2002]

If you want to deal with other formats, you will need to subclass 
QueryParser and override getRangeQuery and do your own thing there.

	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