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


length_to = 10

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

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.


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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupjava-user @
postedFeb 18, '05 at 12:38p
activeFeb 18, '05 at 12:38p

1 user in discussion

Aad Nales: 1 post



site design / logo © 2022 Grokbase