lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject RE: RangeQuery or BooleanQuery?
Date Tue, 28 Feb 2006 19:03:23 GMT

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

	http://wiki.apache.org/jakarta-lucene/SearchNumericalFields


-Hoss


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


Mime
View raw message