Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ICUCollationKeyAnalyzer

    Configures Lucene.Net.Analysis.Core.KeywordTokenizer with ICUCollationAttributeFactory.

    Inheritance
    object
    Analyzer
    ICUCollationKeyAnalyzer
    Implements
    IDisposable
    Inherited Members
    Analyzer.NewAnonymous(Func<string, TextReader, TokenStreamComponents>)
    Analyzer.NewAnonymous(Func<string, TextReader, TokenStreamComponents>, ReuseStrategy)
    Analyzer.NewAnonymous(Func<string, TextReader, TokenStreamComponents>, Func<string, TextReader, TextReader>)
    Analyzer.NewAnonymous(Func<string, TextReader, TokenStreamComponents>, Func<string, TextReader, TextReader>, ReuseStrategy)
    Analyzer.GetTokenStream(string, TextReader)
    Analyzer.GetTokenStream(string, string)
    Analyzer.GetPositionIncrementGap(string)
    Analyzer.GetOffsetGap(string)
    Analyzer.Strategy
    Analyzer.Dispose()
    Analyzer.GLOBAL_REUSE_STRATEGY
    Analyzer.PER_FIELD_REUSE_STRATEGY
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Collation
    Assembly: Lucene.Net.ICU.dll
    Syntax
    public sealed class ICUCollationKeyAnalyzer : Analyzer, IDisposable
    Remarks

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

    WARNING: Make sure you use exactly the same ICU4N.Text.Collator at index and query time -- CollationKeys are only comparable when produced by the same ICU4N.Text.Collator. ICU4N.Text.RuleBasedCollators are independently versioned, so it is safe to search against stored ICU4N.Text.CollationKeys 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 ICU4N.Text.Collator Version
    2. The collation strength used - see ICU4N.Text.Collator.Strength

    ICU4N.Text.CollationKeys 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 Lucene.Net.Util.LuceneVersion compatibility when creating ICUCollationKeyAnalyzer:
    • As of 4.0, ICU4N.Text.CollationKeys are directly encoded as bytes. Previous versions will encode the bytes with Lucene.Net.Util.IndexableBinaryStringTools.

    Constructors

    ICUCollationKeyAnalyzer(Collator)

    Configures Lucene.Net.Analysis.Core.KeywordTokenizer with ICUCollationAttributeFactory.

    Declaration
    [Obsolete("Use ICUCollationKeyAnalyzer.ICUCollationKeyAnalyzer(LuceneVersion, Collator) and specify a version instead. This ctor will be removed in Lucene 5.0")]
    public ICUCollationKeyAnalyzer(Collator collator)
    Parameters
    Type Name Description
    Collator collator
    Remarks

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

    WARNING: Make sure you use exactly the same ICU4N.Text.Collator at index and query time -- CollationKeys are only comparable when produced by the same ICU4N.Text.Collator. ICU4N.Text.RuleBasedCollators are independently versioned, so it is safe to search against stored ICU4N.Text.CollationKeys 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 ICU4N.Text.Collator Version
    2. The collation strength used - see ICU4N.Text.Collator.Strength

    ICU4N.Text.CollationKeys 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 Lucene.Net.Util.LuceneVersion compatibility when creating ICUCollationKeyAnalyzer:
    • As of 4.0, ICU4N.Text.CollationKeys are directly encoded as bytes. Previous versions will encode the bytes with Lucene.Net.Util.IndexableBinaryStringTools.

    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

    ICU4N.Text.CollationKey generator.

    Remarks

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

    WARNING: Make sure you use exactly the same ICU4N.Text.Collator at index and query time -- CollationKeys are only comparable when produced by the same ICU4N.Text.Collator. ICU4N.Text.RuleBasedCollators are independently versioned, so it is safe to search against stored ICU4N.Text.CollationKeys 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 ICU4N.Text.Collator Version
    2. The collation strength used - see ICU4N.Text.Collator.Strength

    ICU4N.Text.CollationKeys 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 Lucene.Net.Util.LuceneVersion compatibility when creating ICUCollationKeyAnalyzer:
    • As of 4.0, ICU4N.Text.CollationKeys are directly encoded as bytes. Previous versions will encode the bytes with Lucene.Net.Util.IndexableBinaryStringTools.

    Methods

    CreateComponents(string, TextReader)

    Creates a new Lucene.Net.Analysis.TokenStreamComponents instance for this analyzer.

    Declaration
    protected override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
    Parameters
    Type Name Description
    string fieldName

    the name of the fields content passed to the Lucene.Net.Analysis.TokenStreamComponents sink as a reader

    TextReader reader

    the reader passed to the Lucene.Net.Analysis.Tokenizer constructor

    Returns
    Type Description
    TokenStreamComponents

    the Lucene.Net.Analysis.TokenStreamComponents for this analyzer.

    Overrides
    Analyzer.CreateComponents(string, TextReader)
    Remarks

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

    WARNING: Make sure you use exactly the same ICU4N.Text.Collator at index and query time -- CollationKeys are only comparable when produced by the same ICU4N.Text.Collator. ICU4N.Text.RuleBasedCollators are independently versioned, so it is safe to search against stored ICU4N.Text.CollationKeys 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 ICU4N.Text.Collator Version
    2. The collation strength used - see ICU4N.Text.Collator.Strength

    ICU4N.Text.CollationKeys 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 Lucene.Net.Util.LuceneVersion compatibility when creating ICUCollationKeyAnalyzer:
    • As of 4.0, ICU4N.Text.CollationKeys are directly encoded as bytes. Previous versions will encode the bytes with Lucene.Net.Util.IndexableBinaryStringTools.

    Implements

    IDisposable
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.