Class PerFieldAnalyzerWrapper
This analyzer is used to facilitate scenarios where different fields Require different analysis techniques. Use the Map argument in PerFieldAnalyzerWrapper(Analyzer, IDictionary<String, Analyzer>) to add non-default analyzers for fields.
Example usage:
IDictionary<string, Analyzer> analyzerPerField = new Dictionary<string, Analyzer>();
analyzerPerField["firstname"] = new KeywordAnalyzer();
analyzerPerField["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.
Inherited Members
Lucene.Net.Analysis.AnalyzerWrapper.WrapReader(System.String, System.IO.TextReader)
Lucene.Net.Analysis.AnalyzerWrapper.CreateComponents(System.String, System.IO.TextReader)
Lucene.Net.Analysis.AnalyzerWrapper.InitReader(System.String, System.IO.TextReader)
Lucene.Net.Analysis.Analyzer.NewAnonymous(System.Func<System.String, System.IO.TextReader, Lucene.Net.Analysis.TokenStreamComponents>)
Lucene.Net.Analysis.Analyzer.NewAnonymous(System.Func<System.String, System.IO.TextReader, Lucene.Net.Analysis.TokenStreamComponents>, Lucene.Net.Analysis.ReuseStrategy)
Lucene.Net.Analysis.Analyzer.NewAnonymous(System.Func<System.String, System.IO.TextReader, Lucene.Net.Analysis.TokenStreamComponents>, System.Func<System.String, System.IO.TextReader, System.IO.TextReader>)
Lucene.Net.Analysis.Analyzer.NewAnonymous(System.Func<System.String, System.IO.TextReader, Lucene.Net.Analysis.TokenStreamComponents>, System.Func<System.String, System.IO.TextReader, System.IO.TextReader>, Lucene.Net.Analysis.ReuseStrategy)
Lucene.Net.Analysis.Analyzer.GetTokenStream(System.String, System.IO.TextReader)
Lucene.Net.Analysis.Analyzer.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
[Serializable]
public sealed class PerFieldAnalyzerWrapper : AnalyzerWrapper, IDisposable
Constructors
Name | Description |
---|---|
PerFieldAnalyzerWrapper(Analyzer) | Constructs with default analyzer. |
PerFieldAnalyzerWrapper(Analyzer, IDictionary<String, Analyzer>) | Constructs with default analyzer and a map of analyzers to use for specific fields. |
Methods
Name | Description |
---|---|
GetWrappedAnalyzer(String) | |
ToString() |