Class ICUCollationDocValuesField
- java.lang.Object
-
- org.apache.lucene.document.Field
-
- org.apache.lucene.collation.ICUCollationDocValuesField
-
- All Implemented Interfaces:
IndexableField
public final class ICUCollationDocValuesField extends Field
Indexes collation keys as a single-valuedSortedDocValuesField
.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 viaDocValuesRangeQuery
, 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
Field.Store
-
-
Field Summary
Fields Modifier and Type Field Description private BytesRef
bytes
private com.ibm.icu.text.Collator
collator
private com.ibm.icu.text.RawCollationKey
key
private java.lang.String
name
-
Fields inherited from class org.apache.lucene.document.Field
fieldsData, tokenStream, type
-
-
Constructor Summary
Constructors Constructor Description ICUCollationDocValuesField(java.lang.String name, com.ibm.icu.text.Collator collator)
Create a new ICUCollationDocValuesField.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
name()
Field namevoid
setStringValue(java.lang.String value)
Expert: change the value of this field.-
Methods inherited from class org.apache.lucene.document.Field
binaryValue, fieldType, getCharSequenceValue, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setTokenStream, stringValue, tokenStream, tokenStreamValue, toString
-
-
-
-
Field Detail
-
name
private final java.lang.String name
-
collator
private final com.ibm.icu.text.Collator collator
-
bytes
private final BytesRef bytes
-
key
private final com.ibm.icu.text.RawCollationKey key
-
-
Constructor Detail
-
ICUCollationDocValuesField
public ICUCollationDocValuesField(java.lang.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 namecollator
- Collator for generating collation keys.
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:IndexableField
Field name- Specified by:
name
in interfaceIndexableField
- Overrides:
name
in classField
-
setStringValue
public void setStringValue(java.lang.String value)
Description copied from class:Field
Expert: change the value of this field. This can be used during indexing to re-use a single Field instance to improve indexing speed by avoiding GC cost of new'ing and reclaiming Field instances. Typically a single
Document
instance is re-used as well. This helps most on small documents.Each Field instance should only be used once within a single
Document
instance. See ImproveIndexingSpeed for details.- Overrides:
setStringValue
in classField
-
-