Class LimitTokenCountAnalyzer
This Analyzer limits the number of tokens while indexing. It is a replacement for the maximum field length setting inside IndexWriter.
Implements
System.IDisposable
  Inherited Members
      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, IDisposable
  Constructors
| 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 | 
|---|---|---|
| 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 | 
|---|---|---|
| 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 | 
|---|---|
| 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 | |
| TokenStreamComponents | components | 
Returns
| Type | Description | 
|---|---|
| TokenStreamComponents | 
Overrides
Implements
      System.IDisposable