lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kolhoff, Jacqueline - ENCOWAY" <>
Subject Problems with RangeQueries
Date Mon, 09 May 2011 09:09:44 GMT

I have indexed some numeric properties (double) by adding numeric fields like this in a custom
NumericField field = new NumericField(propertyName, Store.YES, true);

This works fine and with my RangeQueries I get results, except in the following case:

I indexed data with the values 4.5, 7.0 and 10.5 for this double property (name: price).

When I search maybe for all data with price > 4.5 AND price < 10.5 I got the correct
results, namely data where price=7.0 (The query is "+price:{4.5 TO *} +price:{* TO 10.5}")

But when I try to search for the opposite, i.e. price <= 4.5 OR price >= 10.5 I get
all data with price=4.5 and price=10.5 but also data with price=7.0 which I do not expect.
The query is: "price:[* TO 4.5] price:[10.5 TO *]"

Did I make something wrong?

Can you help me?

Regards, Jacqueline.

P.S.: The query is built with the NumericFieldUtils like this NumericFieldUtils.createNumericRangeQuery("price",
4.5, null, false, false);

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message