lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: "filtering" using RangeFilter class
Date Fri, 03 Mar 2006 21:57:50 GMT

: I am trying to filter my search using RangeFilter class but i get
: BooleanQuery TooManyClauses exception.

You aren't useing a RangeFilter, you are using a RangeQuery ... they are
very different beasts.  RangeQuery works fine for small ranges, or when
you want the term frequencies of the terms in the range to affect the
scores -- but RangeFilter is what you want to use when you don't want the
scores to vary based on the matching term, or when you are dealing with a
very large range of values.

Wrapping a RangeQuery in a QueryFilter doesn't change the internal
behavior, just the way you use it.

: rangeFilter = new RangeQuery(new Term(metadata, lowerVal), new Term(metadata, upperVal),
: QueryFilter orgFilter = new QueryFilter(rangeFilter);
: Query query = QueryParser.parse(userQuery, "contents", new StandardAnalyzer());
: hits =, orgFilter);

try this instead...

  hits =, new RangeFilter(metadata,lowerVal,upperVal,true,true));


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

View raw message