Class FilteredQuery
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.
@since 1.4
Assembly: DistributedLucene.Net.dll
Syntax
public class FilteredQuery : Query
Constructors
Name | Description |
---|---|
FilteredQuery(Query, Filter) | Constructs a new query which applies a filter to the results of the original query. GetDocIdSet(AtomicReaderContext, IBits) will be called every time this query is used in a search. |
FilteredQuery(Query, Filter, FilteredQuery.FilterStrategy) | Expert: Constructs a new query which applies a filter to the results of the original query. GetDocIdSet(AtomicReaderContext, IBits) will be called every time this query is used in a search. |
Fields
Name | Description |
---|---|
LEAP_FROG_FILTER_FIRST_STRATEGY | A filter strategy that uses a "leap-frog" approach (also called "zig-zag join"). The scorer and the filter take turns trying to advance to each other's next matching document, often jumping past the target document. When both land on the same document, it's collected. Note: this strategy uses the filter to lead the iteration. |
LEAP_FROG_QUERY_FIRST_STRATEGY | A filter strategy that uses a "leap-frog" approach (also called "zig-zag join"). The scorer and the filter take turns trying to advance to each other's next matching document, often jumping past the target document. When both land on the same document, it's collected. Note: this strategy uses the query to lead the iteration. |
QUERY_FIRST_FILTER_STRATEGY | A filter strategy that advances the Query or rather its Scorer first and consults the filter DocIdSet for each matched document. Note: this strategy requires a Bits to return a non-null value. Otherwise this strategy falls back to LEAP_FROG_QUERY_FIRST_STRATEGY Use this strategy if the filter computation is more expensive than document scoring or if the filter has a linear running time to compute the next matching doc like exact geo distances. |
RANDOM_ACCESS_FILTER_STRATEGY | A FilteredQuery.FilterStrategy that conditionally uses a random access filter if
the given DocIdSet supports random access (returns a non-null value
from Bits) and
UseRandomAccess(IBits, Int32) returns
Note: this strategy is the default strategy in FilteredQuery |
Properties
Name | Description |
---|---|
Filter | Returns this FilteredQuery's filter |
Query | Returns this FilteredQuery's (unfiltered) Query |
Strategy | Returns this FilteredQuery's FilteredQuery.FilterStrategy |
Methods
Name | Description |
---|---|
CreateWeight(IndexSearcher) | Returns a Weight that applies the filter to the enclosed query's Weight. this is accomplished by overriding the Scorer returned by the Weight. |
Equals(Object) | Returns true if |
ExtractTerms(ISet<Term>) | Expert: adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten (Rewrite(IndexReader)) form. |
GetHashCode() | Returns a hash code value for this object. |
Rewrite(IndexReader) | Rewrites the query. If the wrapped is an instance of MatchAllDocsQuery it returns a ConstantScoreQuery. Otherwise it returns a new FilteredQuery wrapping the rewritten query. |
ToString(String) | Prints a user-readable version of this query. |