Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ICUCollationAttributeFactory

    Converts each token into its ICU4N.Text.CollationKey, and then encodes bytes as an index term.

    Inheritance
    object
    AttributeSource.AttributeFactory
    ICUCollationAttributeFactory
    Inherited Members
    AttributeSource.AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Collation
    Assembly: Lucene.Net.ICU.dll
    Syntax
    public class ICUCollationAttributeFactory : AttributeSource.AttributeFactory
    Remarks

    WARNING: Make sure you use exactly the same ICU4N.Text.Collator at index and query time -- ICU4N.Text.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 ICUCollationAttributeFactory to generate index terms, do not use CollationAttributeFactory on the query side, or vice versa.

    ICUCollationAttributeFactory is significantly faster and generates significantly shorter keys than CollationAttributeFactory. 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.

    Constructors

    ICUCollationAttributeFactory(Collator)

    Create an ICUCollationAttributeFactory, using Lucene.Net.Util.AttributeSource.AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY as the factory for all other attributes.

    Declaration
    public ICUCollationAttributeFactory(Collator collator)
    Parameters
    Type Name Description
    Collator collator

    ICU4N.Text.CollationKey generator

    Remarks

    WARNING: Make sure you use exactly the same ICU4N.Text.Collator at index and query time -- ICU4N.Text.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 ICUCollationAttributeFactory to generate index terms, do not use CollationAttributeFactory on the query side, or vice versa.

    ICUCollationAttributeFactory is significantly faster and generates significantly shorter keys than CollationAttributeFactory. 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.

    ICUCollationAttributeFactory(AttributeFactory, Collator)

    Create an ICUCollationAttributeFactory, using the supplied Attribute Factory as the factory for all other attributes.

    Declaration
    public ICUCollationAttributeFactory(AttributeSource.AttributeFactory @delegate, Collator collator)
    Parameters
    Type Name Description
    AttributeSource.AttributeFactory delegate

    Attribute Factory

    Collator collator

    ICU4N.Text.CollationKey generator

    Remarks

    WARNING: Make sure you use exactly the same ICU4N.Text.Collator at index and query time -- ICU4N.Text.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 ICUCollationAttributeFactory to generate index terms, do not use CollationAttributeFactory on the query side, or vice versa.

    ICUCollationAttributeFactory is significantly faster and generates significantly shorter keys than CollationAttributeFactory. 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.

    Methods

    CreateAttributeInstance<T>()

    returns an Lucene.Net.Util.Attribute for the supplied Lucene.Net.Util.IAttribute interface.

    Declaration
    public override Attribute CreateAttributeInstance<T>() where T : IAttribute
    Returns
    Type Description
    Attribute
    Type Parameters
    Name Description
    T
    Overrides
    Lucene.Net.Util.AttributeSource.AttributeFactory.CreateAttributeInstance<T>()
    Remarks

    WARNING: Make sure you use exactly the same ICU4N.Text.Collator at index and query time -- ICU4N.Text.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 ICUCollationAttributeFactory to generate index terms, do not use CollationAttributeFactory on the query side, or vice versa.

    ICUCollationAttributeFactory is significantly faster and generates significantly shorter keys than CollationAttributeFactory. 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.
    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.