org.apache.lucene.search
Class FilteredQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.search.FilteredQuery
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class FilteredQuery extends Query
A query that applies a filter to the results of another query.Note: the bits are retrieved from the filter each time this query is used in a search - use a CachingWrapperFilter to avoid regenerating the bits every time.
Created: Apr 20, 2004 8:58:29 AM
- Since:
- 1.4
- See Also:
CachingWrapperFilter, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description FilteredQuery(Query query, Filter filter)Constructs a new query which applies a filter to the results of the original query.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)Returns true iffois equal to this.voidextractTerms(java.util.Set terms)Expert: adds all terms occuring in this query to the terms set.FiltergetFilter()QuerygetQuery()inthashCode()Returns a hash code value for this object.Queryrewrite(IndexReader reader)Rewrites the wrapped query.java.lang.StringtoString(java.lang.String s)Prints a user-readable version of this query.-
Methods inherited from class org.apache.lucene.search.Query
clone, combine, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight
-
-
-
-
Constructor Detail
-
FilteredQuery
public FilteredQuery(Query query, Filter filter)
Constructs a new query which applies a filter to the results of the original query. Filter.bits() will be called every time this query is used in a search.- Parameters:
query- Query to be filtered, cannot benull.filter- Filter to apply to query results, cannot benull.
-
-
Method Detail
-
rewrite
public Query rewrite(IndexReader reader) throws java.io.IOException
Rewrites the wrapped query.
-
getQuery
public Query getQuery()
-
getFilter
public Filter getFilter()
-
extractTerms
public void extractTerms(java.util.Set terms)
Description copied from class:QueryExpert: adds all terms occuring in this query to the terms set. Only works if this query is in itsrewrittenform.- Overrides:
extractTermsin classQuery
-
toString
public java.lang.String toString(java.lang.String s)
Prints a user-readable version of this query.
-
equals
public boolean equals(java.lang.Object o)
Returns true iffois equal to this.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hash code value for this object.- Overrides:
hashCodein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG