Show / Hide Table of Contents

    Class ICUCollationKeyAnalyzer

    Configures KeywordTokenizer with ICUCollationAttributeFactory.

    Inheritance
    System.Object
    Analyzer
    ICUCollationKeyAnalyzer
    Inherited Members
    Lucene.Net.Analysis.Analyzer.NewAnonymous(Func<, , >)
    Lucene.Net.Analysis.Analyzer.NewAnonymous(Func<, , >, Lucene.Net.Analysis.ReuseStrategy)
    Lucene.Net.Analysis.Analyzer.NewAnonymous(Func<, , >, Func<, , >)
    Lucene.Net.Analysis.Analyzer.NewAnonymous(Func<, , >, Func<, , >, Lucene.Net.Analysis.ReuseStrategy)
    Analyzer.GetTokenStream(String, TextReader)
    Analyzer.GetTokenStream(String, String)
    Analyzer.InitReader(String, TextReader)
    Analyzer.GetPositionIncrementGap(String)
    Analyzer.GetOffsetGap(String)
    Analyzer.Strategy
    Analyzer.Dispose()
    Analyzer.Dispose(Boolean)
    Analyzer.GLOBAL_REUSE_STRATEGY
    Analyzer.PER_FIELD_REUSE_STRATEGY
    Namespace: Lucene.Net.Collation
    Assembly: Lucene.Net.ICU.dll
    Syntax
    public sealed class ICUCollationKeyAnalyzer : Analyzer
    Remarks

    Converts the token into its , and then encodes the either directly or with IndexableBinaryStringTools (see below), to allow it to be stored as an index term.

    WARNING: Make sure you use exactly the same at index and query time -- CollationKeys are only comparable when produced by the same . s are independently versioned, so it is safe to search against stored s if the following are exactly the same (best practice is to store this information with the index and check that they remain the same at query time):

    1. Collator version - see Version
    2. The collation strength used - see

    s generated by ICU Collators are not compatible with those generated by java.text.Collators. Specifically, if you use ICUCollationKeyAnalyzer to generate index terms, do not use CollationKeyAnalyzer on the query side, or vice versa.

    ICUCollationKeyAnalyzer is significantly faster and generates significantly shorter keys than CollationKeyAnalyzer. See http://site.icu-project.org/charts/collation-icu4j-sun for key generation timing and key length comparisons between ICU4J and java.text.Collator over several languages.

    You must specify the required LuceneVersion compatibility when creating ICUCollationKeyAnalyzer:

    • As of 4.0, s are directly encoded as bytes. Previous versions will encode the bytes with IndexableBinaryStringTools.

    Constructors

    | Improve this Doc View Source

    ICUCollationKeyAnalyzer(Collator)

    Declaration
    public ICUCollationKeyAnalyzer(Collator collator)
    Parameters
    Type Name Description
    Collator collator
    | Improve this Doc View Source

    ICUCollationKeyAnalyzer(LuceneVersion, Collator)

    Create a new ICUCollationKeyAnalyzer, using the specified collator.

    Declaration
    public ICUCollationKeyAnalyzer(LuceneVersion matchVersion, Collator collator)
    Parameters
    Type Name Description
    LuceneVersion matchVersion

    See ICUCollationKeyAnalyzer.

    Collator collator

    generator.

    Methods

    | Improve this Doc View Source

    CreateComponents(String, TextReader)

    Declaration
    protected override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
    Parameters
    Type Name Description
    System.String fieldName
    TextReader reader
    Returns
    Type Description
    TokenStreamComponents
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • ICUCollationKeyAnalyzer(Collator)
      • ICUCollationKeyAnalyzer(LuceneVersion, Collator)
    • Methods
      • CreateComponents(String, TextReader)
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)