Class FieldCacheTermsFilter
A Filter that only accepts documents whose single term value in the specified field is contained in the provided set of allowed terms.
This is the same functionality as TermsFilter (from queries/), except this filter requires that the field contains only a single term for all documents. Because of drastically different implementations, they also have different performance characteristics, as described below.
The first invocation of this filter on a given field will
be slower, since a Sorted
With each search, this filter translates the specified
set of Terms into a private Fixed
In contrast, TermsFilter builds up a Fixed
Generally, this filter will be slower on the first invocation for a given field, but subsequent invocations, even if you change the allowed set of Terms, should be faster than TermsFilter, especially as the number of Terms being matched increases. If you are matching only a very small number of terms, and those terms in turn match a very small number of documents, TermsFilter may perform faster.
Which filter is best is very application dependent.
Inherited Members
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public class FieldCacheTermsFilter : Filter
Constructors
| Improve this Doc View SourceFieldCacheTermsFilter(String, BytesRef[])
Declaration
public FieldCacheTermsFilter(string field, params BytesRef[] terms)
Parameters
Type | Name | Description |
---|---|---|
System. |
field | |
Bytes |
terms |
FieldCacheTermsFilter(String, String[])
Declaration
public FieldCacheTermsFilter(string field, params string[] terms)
Parameters
Type | Name | Description |
---|---|---|
System. |
field | |
System. |
terms |
Properties
| Improve this Doc View SourceFieldCache
Declaration
public virtual IFieldCache FieldCache { get; }
Property Value
Type | Description |
---|---|
IField |
Methods
| Improve this Doc View SourceGetDocIdSet(AtomicReaderContext, IBits)
Declaration
public override DocIdSet GetDocIdSet(AtomicReaderContext context, IBits acceptDocs)
Parameters
Type | Name | Description |
---|---|---|
Atomic |
context | |
IBits | acceptDocs |
Returns
Type | Description |
---|---|
Doc |