public class FilteredQuery extends 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
CachingWrapperFilter
,
Serialized FormConstructor and Description |
---|
FilteredQuery(Query query,
Filter filter)
Constructs a new query which applies a filter to the results of the original query.
|
Modifier and Type | Method and Description |
---|---|
protected Weight |
createWeight(Searcher searcher)
Returns a Weight that applies the filter to the enclosed query's Weight.
|
boolean |
equals(java.lang.Object o)
Returns true iff
o is equal to this. |
void |
extractTerms(java.util.Set terms)
Expert: adds all terms occuring in this query to the terms set.
|
Filter |
getFilter() |
Query |
getQuery() |
int |
hashCode()
Returns a hash code value for this object.
|
Query |
rewrite(IndexReader reader)
Rewrites the wrapped query.
|
java.lang.String |
toString(java.lang.String s)
Prints a user-readable version of this query.
|
clone, combine, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight
public FilteredQuery(Query query, Filter filter)
query
- Query to be filtered, cannot be null
.filter
- Filter to apply to query results, cannot be null
.protected Weight createWeight(Searcher searcher) throws java.io.IOException
createWeight
in class Query
java.io.IOException
public Query rewrite(IndexReader reader) throws java.io.IOException
public Query getQuery()
public Filter getFilter()
public void extractTerms(java.util.Set terms)
Query
rewritten
form.extractTerms
in class Query
public java.lang.String toString(java.lang.String s)
public boolean equals(java.lang.Object o)
o
is equal to this.equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.