Class FilteringTokenFilter
Abstract base class for TokenFilters that may remove tokens.
You have to implement Accept() and return a boolean if the current
token should be preserved. Increment
As of Lucene 4.4, an
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.Util
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public abstract class FilteringTokenFilter : TokenFilter, IDisposable
Constructors
| Improve this Doc View SourceFilteringTokenFilter(LuceneVersion, TokenStream)
Create a new Filtering
Declaration
public FilteringTokenFilter(LuceneVersion version, TokenStream in)
Parameters
Type | Name | Description |
---|---|---|
Lucene |
version | the Lucene match version |
Token |
in | the Token |
FilteringTokenFilter(LuceneVersion, Boolean, TokenStream)
Create a new Filtering
Declaration
public FilteringTokenFilter(LuceneVersion version, bool enablePositionIncrements, TokenStream input)
Parameters
Type | Name | Description |
---|---|---|
Lucene |
version | |
System. |
enablePositionIncrements | whether to increment position increments when filtering out terms |
Token |
input | the input to consume |
Fields
| Improve this Doc View Sourcem_version
Declaration
protected readonly LuceneVersion m_version
Field Value
Type | Description |
---|---|
Lucene |
Properties
| Improve this Doc View SourceEnablePositionIncrements
Declaration
public virtual bool EnablePositionIncrements { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceAccept()
Override this method and return if the current input token should be returned by Increment
Declaration
protected abstract bool Accept()
Returns
Type | Description |
---|---|
System. |
End()
Declaration
public override void End()
Overrides
| Improve this Doc View SourceIncrementToken()
Declaration
public override sealed bool IncrementToken()
Returns
Type | Description |
---|---|
System. |
Overrides
| Improve this Doc View SourceReset()
Declaration
public override void Reset()
Overrides
| Improve this Doc View SourceSetEnablePositionIncrements(Boolean)
If true
, this Tokentrue
is best as it does not
lose information (positions of the original tokens)
during indexing.
When set, when a token is stopped (omitted), the position increment of the following token is incremented.
Declaration
public virtual void SetEnablePositionIncrements(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System. |
enable |