Class ICUCollationKeyFilter
Converts each token into its ICU4N.Text.CollationKey, and then encodes the ICU4N.Text.CollationKey with Lucene.Net.Util.IndexableBinaryStringTools, to allow it to be stored as an index term.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Collation
Assembly: Lucene.Net.ICU.dll
Syntax
[Obsolete("Use ICUCollationAttributeFactory instead, which encodes terms directly as bytes. This filter will be removed in Lucene 5.0")]
public sealed class ICUCollationKeyFilter : TokenFilter, IDisposable
Remarks
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):
- Collator version - see ICU4N.Text.Collator Version
- 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.
Constructors
| Improve this Doc View SourceICUCollationKeyFilter(TokenStream, Collator)
Creates a new ICUCollationKeyFilter.
Declaration
public ICUCollationKeyFilter(TokenStream input, Collator collator)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Analysis.TokenStream | input | Source token stream. |
ICU4N.Text.Collator | collator | ICU4N.Text.CollationKey generator. |
Methods
| Improve this Doc View SourceIncrementToken()
Declaration
public override bool IncrementToken()
Returns
Type | Description |
---|---|
System.Boolean |