lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Seeta Somagani" <>
Subject RE: RangeQuery or BooleanQuery?
Date Tue, 28 Feb 2006 21:30:26 GMT

Your observation about the spaces seems very likely. I hence, removed the spaces, padded the
numbers and also tried using the RangeFilter, but still I got the same result. Upon closer
inspection of my code, I found that I was tokenizing the "id" field, which was rendering that
field illegible for the filter. I promptly changed it to UNTOKENIZED and now the RangeFilter
recognizes the field. I discovered that I'd have to take care of more issues before I can
make sure that this works.

Thanks so much

-----Original Message-----
From: Chris Hostetter [] 
Sent: Tuesday, February 28, 2006 2:03 PM
Subject: RE: RangeQuery or BooleanQuery?

there are a couple of things that could be happening that make your
results unexpected...

: But, when I enter the query - id: [104 TO 200] content: "Marbella
: España" it's just returning me all the results while ignoring the range.

1) if you really have a space between the "id:" and the "[104 TO 200]" i
don't know what you'll get ... i imagine you are searching the default
field for the literal string "id:" and for the range.  likewise for
content: and the phrase after it.

2) last time i looked when query parser detects multiple queries that it
puts into a BooleanQuery, it defualts to making them all optional unless
they have a specific "occurs" flag indicating thatthey should be required
or prohibited.  changing your query to...
         +id:[104 TO 200] +content:"Marbella España"
...may create the desired affect.

3) indexing numbers is tricky when you want to sort on those numbers, or
do range queries on those numbers becuase lucene orders everything
lexigraphically, so a range of [104 TO 200] includes numbers like "2" and
"20".  there has been a lot of talk on this in the mailing list in the
past, and a wiki HOWTO has been written about it that you should review...


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message