lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aad Nales <aad.na...@rotterdam-cs.com>
Subject RangeQuery with null end value seems off..
Date Fri, 18 Feb 2005 12:38:28 GMT
Hi all,

I am building a searchinterface where the user looks for product 
descriptions that fit his or her specs. One potential specs is for 
instance length. The product description holds two fields:

length_from = 1

and

length_to = 10

If the query value is 5 the search should be succesful. Here is what is 
strange.

I have implemented the query by using two rangeQueries based on a Term.

Term termFrom = new Term ("length_from", "5");
Term termTo = new Term("length_to, "5");

RangeQuery smallerThan = new RangeQuery(null, termTo, true);
RangeQuery largerThan = new RangeQuery(termFrom, null, true);

These two queries are then combined into a BooleanQuery and presto. However:

The smallerThan query seems fine when written out as String: length_to: 
[ TO 5]
The largerThan query however 
outputs:                                     length_from: [ 5 TO null]

What I wonder is: should that null be there? And if it should not (which 
i suspect?) is this a problem for the toString method or is it a problem 
for proper query execution?

Thanks for any input.

Aad

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