lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Simple date/range question
Date Fri, 02 Apr 2004 16:59:52 GMT
YYYYMMDD is the format
You Timestamp contains HH mm, and ss, that's likely why your second
query doesn't match anything.
Drop everything other than YYYYMMDD from the index, and things should
work.

Otis

--- lucene@nitwit.de wrote:
> Hi!
> 
> I do have some problems with date and the QueryParser range syntax.
> 
> code:
> 
> java.sql.Timestamp time = row.getTimestamp("timestamp");
> if (time != null) doc.add(Field.Keyword("date", new
> Date(time.getTime())));
> 
> query:
> date:[20030101 TO 20030202]
> date:20030101
> 
> The first query does throw a ParserException, the second doesn't
> return any 
> hits.
> 
> Hmm...there must be something simple I misunderstood :) BTW what
> about custom 
> date format in QueryParser (...and are the last two digits actually
> the day 
> or month)?
> 
> TIA
> Timo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
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