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: "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),
true);
: QueryFilter orgFilter = new QueryFilter(rangeFilter);
: Query query = QueryParser.parse(userQuery, "contents", new StandardAnalyzer());
: hits = is.search(query, orgFilter);

try this instead...

  hits = is.search(query, new RangeFilter(metadata,lowerVal,upperVal,true,true));




-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