You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Keegan Callin <kc...@kcallin.net> on 2005/12/11 07:38:18 UTC
Large Numeric RangeQueries
Hello and Good Day,
In my application of Lucene, I am must search through some fields that
contain numbers with very large ranges on the order of 150000 or so.
Suppose I wanted to retrieve all documents matching numbers
10000-150000. On first inspection I tried a RangeQuery but, of course,
I quickly discovered that RangeQueries expand to boolean queries that
enumerate every element in their range. In my case, it does not seem
realistic to enumerate all the possible values of the query range as
RangeQuery tries to do.
It has widely been suggested on the web and in in Gospodnetic &
Hatcher's venerable "Lucene In Action" that queries for date ranges be
reduced to simpler terms by more-or-less rounding the dates to the
minute, hour, or day. Unfortunately, in my case the /whole/ number is
significant and I cannot round the numbers. Has anyone some suggestions
as to how I might proceed?
Kindly,
Keegan Callin
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Large Numeric RangeQueries
Posted by markharw00d <ma...@yahoo.co.uk>.
On a related topic: yesterday I posted a round-up of all the possible
filtering options in Lucene with timings and example code to the WIKI :
http://wiki.apache.org/jakarta-lucene/FilteringOptions
One of the options demonstrated is along the lines of Chris's suggestion.
Cheers,
Mark
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Large Numeric RangeQueries
Posted by Chris Hostetter <ho...@fucit.org>.
: 10000-150000. On first inspection I tried a RangeQuery but, of course,
: I quickly discovered that RangeQueries expand to boolean queries that
: enumerate every element in their range. In my case, it does not seem
: realistic to enumerate all the possible values of the query range as
: RangeQuery tries to do.
1) check out RangeFilter
2) check out ConstantScoreRangeQuery
http://svn.apache.org/viewcvs.cgi/lucene/java/trunk/src/java/org/apache/lucene/search/RangeFilter.java
http://svn.apache.org/viewcvs.cgi/lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreRangeQuery.java
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org