C# 클래스 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.

상속: AnalyzerWrapper
파일 보기 프로젝트 열기: paulirwin/lucene.net 1 사용 예제들

공개 메소드들

메소드 설명
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

보호된 메소드들

메소드 설명
getWrappedAnalyzer ( string fieldName ) : Analyzer

메소드 상세

PerFieldAnalyzerWrapper() 공개 메소드

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.
리턴 System.Collections.Generic

PerFieldAnalyzerWrapper() 공개 메소드

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
리턴 System.Collections.Generic

ToString() 공개 메소드

public ToString ( ) : string
리턴 string

getWrappedAnalyzer() 보호된 메소드

protected getWrappedAnalyzer ( string fieldName ) : Analyzer
fieldName string
리턴 Analyzer