Class LimitTokenCountAnalyzer
This Lucene.Net.Analysis.Analyzer limits the number of tokens while indexing. It is a replacement for the maximum field length setting inside IndexWriter.
Inheritance
System.Object
    Lucene.Net.Analysis.Analyzer
    Lucene.Net.Analysis.AnalyzerWrapper
    LimitTokenCountAnalyzer
  Implements
System.IDisposable
  Inherited Members
      Lucene.Net.Analysis.Analyzer.Strategy
    
    
      Lucene.Net.Analysis.Analyzer.Dispose()
    
    
    
      Lucene.Net.Analysis.Analyzer.GLOBAL_REUSE_STRATEGY
    
    
      Lucene.Net.Analysis.Analyzer.PER_FIELD_REUSE_STRATEGY
    
    
      System.Object.Equals(System.Object)
    
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.GetHashCode()
    
    
      System.Object.GetType()
    
    
      System.Object.MemberwiseClone()
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
  Namespace: Lucene.Net.Analysis.Miscellaneous
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public sealed class LimitTokenCountAnalyzer : AnalyzerWrapper, IDisposableConstructors
| Improve this Doc View SourceLimitTokenCountAnalyzer(Analyzer, Int32)
Build an analyzer that limits the maximum number of tokens per field. This analyzer will not consume any tokens beyond the maxTokenCount limit
Declaration
public LimitTokenCountAnalyzer(Analyzer delegate, int maxTokenCount)Parameters
| Type | Name | Description | 
|---|---|---|
| Lucene.Net.Analysis.Analyzer | delegate | |
| System.Int32 | maxTokenCount | 
See Also
| Improve this Doc View SourceLimitTokenCountAnalyzer(Analyzer, Int32, Boolean)
Build an analyzer that limits the maximum number of tokens per field.
Declaration
public LimitTokenCountAnalyzer(Analyzer delegate, int maxTokenCount, bool consumeAllTokens)Parameters
| Type | Name | Description | 
|---|---|---|
| Lucene.Net.Analysis.Analyzer | delegate | the analyzer to wrap | 
| System.Int32 | maxTokenCount | max number of tokens to produce | 
| System.Boolean | consumeAllTokens | whether all tokens from the delegate should be consumed even if maxTokenCount is reached. | 
Methods
| Improve this Doc View SourceGetWrappedAnalyzer(String)
Declaration
protected override Analyzer GetWrappedAnalyzer(string fieldName)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | fieldName | 
Returns
| Type | Description | 
|---|---|
| Lucene.Net.Analysis.Analyzer | 
Overrides
| Improve this Doc View SourceToString()
Declaration
public override string ToString()Returns
| Type | Description | 
|---|---|
| System.String | 
Overrides
System.Object.ToString()
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WrapComponents(String, TokenStreamComponents)
Declaration
protected override TokenStreamComponents WrapComponents(string fieldName, TokenStreamComponents components)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | fieldName | |
| Lucene.Net.Analysis.TokenStreamComponents | components | 
Returns
| Type | Description | 
|---|---|
| Lucene.Net.Analysis.TokenStreamComponents | 
Overrides
Implements
      System.IDisposable