Class TermsFilter
Constructs a filter for docs matching any of the terms added to this class.
Unlike a RangeFilter this can be used for filtering on multiple terms that are not necessarily in
a sequence. An example might be a collection of primary keys from a database query result or perhaps
a choice of "category" labels picked by the end user. As a filter, this is much faster than the
equivalent query (a Lucene.Net.Search.BooleanQuery with many "should" Lucene.Net.Search.TermQuerys)
Inheritance
System.Object
Lucene.Net.Search.Filter
TermsFilter
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Lucene.Net.Queries.dll
Syntax
public sealed class TermsFilter : Filter
Constructors
|
Improve this Doc
View Source
TermsFilter(Term[])
Creates a new TermsFilter from the given array. The array can
contain duplicate terms and multiple fields.
Declaration
public TermsFilter(params Term[] terms)
Parameters
Type |
Name |
Description |
Lucene.Net.Index.Term[] |
terms |
|
|
Improve this Doc
View Source
TermsFilter(IList<Term>)
Creates a new TermsFilter from the given list. The list
can contain duplicate terms and multiple fields.
Declaration
public TermsFilter(IList<Term> terms)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IList<Lucene.Net.Index.Term> |
terms |
|
|
Improve this Doc
View Source
TermsFilter(String, BytesRef[])
Creates a new TermsFilter from the given Lucene.Net.Util.BytesRef array for
a single field.
Declaration
public TermsFilter(string field, params BytesRef[] terms)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Lucene.Net.Util.BytesRef[] |
terms |
|
|
Improve this Doc
View Source
TermsFilter(String, IList<BytesRef>)
Creates a new TermsFilter from the given Lucene.Net.Util.BytesRef list for
a single field.
Declaration
public TermsFilter(string field, IList<BytesRef> terms)
Parameters
Type |
Name |
Description |
System.String |
field |
|
System.Collections.Generic.IList<Lucene.Net.Util.BytesRef> |
terms |
|
Methods
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
|
Improve this Doc
View Source
GetDocIdSet(AtomicReaderContext, IBits)
Declaration
public override DocIdSet GetDocIdSet(AtomicReaderContext context, IBits acceptDocs)
Parameters
Type |
Name |
Description |
Lucene.Net.Index.AtomicReaderContext |
context |
|
Lucene.Net.Util.IBits |
acceptDocs |
|
Returns
Type |
Description |
Lucene.Net.Search.DocIdSet |
|
Overrides
Lucene.Net.Search.Filter.GetDocIdSet(Lucene.Net.Index.AtomicReaderContext, Lucene.Net.Util.IBits)
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()