Package org.apache.lucene.collation
Class CollationDocValuesField
- java.lang.Object
-
- org.apache.lucene.document.Field
-
- org.apache.lucene.collation.CollationDocValuesField
-
- All Implemented Interfaces:
IndexableField
public final class CollationDocValuesField extends Field
Indexes collation keys as a single-valuedSortedDocValuesField
.This is more efficient that
CollationKeyAnalyzer
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 inherited from class org.apache.lucene.document.Field
fieldsData, tokenStream, type
-
-
Constructor Summary
Constructors Constructor Description CollationDocValuesField(String name, Collator collator)
Create a new ICUCollationDocValuesField.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
name()
void
setStringValue(String value)
-
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
-
-
-
-
Constructor Detail
-
CollationDocValuesField
public CollationDocValuesField(String name, 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 String name()
- Specified by:
name
in interfaceIndexableField
- Overrides:
name
in classField
-
setStringValue
public void setStringValue(String value)
- Overrides:
setStringValue
in classField
-
-