Package org.apache.lucene.collation
Class CollationDocValuesField
java.lang.Object
org.apache.lucene.document.Field
org.apache.lucene.collation.CollationDocValuesField
- All Implemented Interfaces:
IndexableField
Indexes collation keys as a single-valued
SortedDocValuesField.
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 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
Field.Store -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BytesRefprivate final Collatorprivate final StringFields inherited from class org.apache.lucene.document.Field
fieldsData, tokenStream, type -
Constructor Summary
ConstructorsConstructorDescriptionCollationDocValuesField(String name, Collator collator) Create a new ICUCollationDocValuesField. -
Method Summary
Modifier and TypeMethodDescriptionname()Field namevoidsetStringValue(String value) Expert: change the value of this field.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
-
Field Details
-
name
-
collator
-
bytes
-
-
Constructor Details
-
CollationDocValuesField
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 Details
-
name
Description copied from interface:IndexableFieldField name- Specified by:
namein interfaceIndexableField- Overrides:
namein classField
-
setStringValue
Description copied from class:FieldExpert: 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 singleDocumentinstance is re-used as well. This helps most on small documents.Each Field instance should only be used once within a single
Documentinstance. See ImproveIndexingSpeed for details.- Overrides:
setStringValuein classField
-