Class ICUCollationDocValuesField

java.lang.Object
org.apache.lucene.document.Field
org.apache.lucene.analysis.icu.ICUCollationDocValuesField
All Implemented Interfaces:
org.apache.lucene.index.IndexableField

public final class ICUCollationDocValuesField extends org.apache.lucene.document.Field
Indexes collation keys as a single-valued SortedDocValuesField.

This is more efficient that ICUCollationKeyAnalyzer if the field only has one value: no uninversion is necessary to sort on the field, locale-sensitive range queries can still work via DocValuesRangeQuery, and the underlying data structures built at index-time are likely more efficient and use less memory than FieldCache.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.lucene.document.Field

    org.apache.lucene.document.Field.Store
  • Field Summary

    Fields inherited from class org.apache.lucene.document.Field

    fieldsData, tokenStream, type
  • Constructor Summary

    Constructors
    Constructor
    Description
    ICUCollationDocValuesField(String name, com.ibm.icu.text.Collator collator)
    Create a new ICUCollationDocValuesField.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
     

    Methods inherited from class org.apache.lucene.document.Field

    binaryValue, fieldType, getCharSequenceValue, invertableType, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setTokenStream, storedValue, stringValue, tokenStream, tokenStreamValue, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ICUCollationDocValuesField

      public ICUCollationDocValuesField(String name, com.ibm.icu.text.Collator collator)
      Create a new ICUCollationDocValuesField.

      NOTE: you should not create a new one for each document, instead just make one and reuse it during your indexing process, setting the value via setStringValue(String).

      Parameters:
      name - field name
      collator - Collator for generating collation keys.
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface org.apache.lucene.index.IndexableField
      Overrides:
      name in class org.apache.lucene.document.Field
    • setStringValue

      public void setStringValue(String value)
      Overrides:
      setStringValue in class org.apache.lucene.document.Field