lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashley Collins" <acoll...@hotmail.com>
Subject QueryParser and date ranges?
Date Wed, 18 Dec 2002 13:50:27 GMT

I'm having trouble with date ranges...It seems that if the lower bound in 
the range is left blank, the upper bound becomes the first value of the 
parsed query.

Which means, that I get results after the end date instead of before it.

Here is some of my debug output when both lower and upper bounds exist:

  Query is date_sent:[0d7zcfeo0 - 0d94s7400]
  Parsed query is: date_sent:[0d7zcfeo0-0d94s7400]

But this is what happens when the lower bound is blank:

  Query is date_sent:[ - 0d94s7400]
  Parsed query is: date_sent:[0d94s7400-null]

Here's the code which produces this output...

log(Level.DEBUG, "Query is " + query);
Analyzer analyzer = new BlackBoxAnalyzer();
Query luceneQuery = QueryParser.parse(query, "message_keywords", analyzer);

log(Level.DEBUG, "Parsed query is: 
"+luceneQuery.toString("message_keywords"));


The BlackBoxAnalyzer is just a custom Analyzer which doesn't tokenize fields 
called "sender" or "recipient".

Can anyone help?

Thanks.
Ashley


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus


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


Mime
View raw message