This analyzer is used to facilitate scenarios where different fields require different analysis techniques. Use {@link #addAnalyzer} to add a non-default analyzer on a field name basis.

Example usage:

            PerFieldAnalyzerWrapper aWrapper =
            new PerFieldAnalyzerWrapper(new StandardAnalyzer());
            aWrapper.addAnalyzer("firstname", new KeywordAnalyzer());
            aWrapper.addAnalyzer("lastname", new KeywordAnalyzer());
            

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.

Namespace: Lucene.Net.Analysis
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
public class PerFieldAnalyzerWrapper : Analyzer
Visual Basic
Public Class PerFieldAnalyzerWrapper _
	Inherits Analyzer
Visual C++
public ref class PerFieldAnalyzerWrapper : public Analyzer

Inheritance Hierarchy

System..::..Object
  Lucene.Net.Analysis..::..Analyzer
    Lucene.Net.Analysis..::..PerFieldAnalyzerWrapper

See Also