C# Class org.apache.lucene.analysis.miscellaneous.PerFieldAnalyzerWrapper

This analyzer is used to facilitate scenarios where different fields require different analysis techniques. Use the Map argument in #PerFieldAnalyzerWrapper(Analyzer, java.util.Map) to add non-default analyzers for fields.

Example usage:

 {@code Map analyzerPerField = new HashMap<>(); analyzerPerField.put("firstname", new KeywordAnalyzer()); analyzerPerField.put("lastname", new KeywordAnalyzer()); PerFieldAnalyzerWrapper aWrapper = new PerFieldAnalyzerWrapper(new StandardAnalyzer(version), analyzerPerField); } 

In this example, StandardAnalyzer will be used for all fields except "firstname" and "lastname", for which KeywordAnalyzer will be used.

A PerFieldAnalyzerWrapper can be used like any other analyzer, for both indexing and query parsing.

Inheritance: AnalyzerWrapper
Afficher le fichier Open project: paulirwin/lucene.net Class Usage Examples

Méthodes publiques

Méthode Description
PerFieldAnalyzerWrapper ( Analyzer defaultAnalyzer ) : System.Collections.Generic

Constructs with default analyzer.

PerFieldAnalyzerWrapper ( Analyzer defaultAnalyzer, Analyzer>.IDictionary fieldAnalyzers ) : System.Collections.Generic

Constructs with default analyzer and a map of analyzers to use for specific fields.

ToString ( ) : string

Méthodes protégées

Méthode Description
getWrappedAnalyzer ( string fieldName ) : Analyzer

Method Details

PerFieldAnalyzerWrapper() public méthode

Constructs with default analyzer.
public PerFieldAnalyzerWrapper ( Analyzer defaultAnalyzer ) : System.Collections.Generic
defaultAnalyzer Analyzer Any fields not specifically /// defined to use a different analyzer will use the one provided here.
Résultat System.Collections.Generic

PerFieldAnalyzerWrapper() public méthode

Constructs with default analyzer and a map of analyzers to use for specific fields.
public PerFieldAnalyzerWrapper ( Analyzer defaultAnalyzer, Analyzer>.IDictionary fieldAnalyzers ) : System.Collections.Generic
defaultAnalyzer Analyzer Any fields not specifically /// defined to use a different analyzer will use the one provided here.
fieldAnalyzers Analyzer>.IDictionary a Map (String field name to the Analyzer) to be /// used for those fields
Résultat System.Collections.Generic

ToString() public méthode

public ToString ( ) : string
Résultat string

getWrappedAnalyzer() protected méthode

protected getWrappedAnalyzer ( string fieldName ) : Analyzer
fieldName string
Résultat Analyzer