Class Lucene45DocValuesConsumer
java.lang.Object
org.apache.lucene.codecs.DocValuesConsumer
org.apache.lucene.codecs.lucene45.Lucene45DocValuesConsumer
- All Implemented Interfaces:
Closeable
,AutoCloseable
writer for
Lucene45DocValuesFormat
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Uncompressed binary, written directly (fixed length).static final int
Compressed binary with shared prefixesstatic final int
Uncompressed binary, written directly (variable length).static final int
Compressed using packed blocks of ints.static final int
Compressed by computing the GCD.static final int
Single-valued sorted set values, encoded as sorted values, so no level of indirection: docId -> ord.static final int
Standard storage for sorted set values with 1 level of indirection: docId -> address -> ord.static final int
Compressed by giving IDs to unique values. -
Constructor Summary
ConstructorsConstructorDescriptionLucene45DocValuesConsumer
(SegmentWriteState state, String dataCodec, String dataExtension, String metaCodec, String metaExtension) expert: Creates a new writer -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBinaryField
(FieldInfo field, Iterable<BytesRef> values) Writes binary docvalues for a field.void
addNumericField
(FieldInfo field, Iterable<Number> values) Writes numeric docvalues for a field.void
Writes pre-sorted binary docvalues for a field.void
addSortedSetField
(FieldInfo field, Iterable<BytesRef> values, Iterable<Number> docToOrdCount, Iterable<Number> ords) Writes pre-sorted set docvalues for a fieldprotected void
addTermsDict
(FieldInfo field, Iterable<BytesRef> values) expert: writes a value dictionary for a sorted/sortedset fieldvoid
close()
Methods inherited from class org.apache.lucene.codecs.DocValuesConsumer
mergeBinaryField, mergeNumericField, mergeSortedField, mergeSortedSetField
-
Field Details
-
DELTA_COMPRESSED
public static final int DELTA_COMPRESSEDCompressed using packed blocks of ints.- See Also:
-
GCD_COMPRESSED
public static final int GCD_COMPRESSEDCompressed by computing the GCD.- See Also:
-
TABLE_COMPRESSED
public static final int TABLE_COMPRESSEDCompressed by giving IDs to unique values.- See Also:
-
BINARY_FIXED_UNCOMPRESSED
public static final int BINARY_FIXED_UNCOMPRESSEDUncompressed binary, written directly (fixed length).- See Also:
-
BINARY_VARIABLE_UNCOMPRESSED
public static final int BINARY_VARIABLE_UNCOMPRESSEDUncompressed binary, written directly (variable length).- See Also:
-
BINARY_PREFIX_COMPRESSED
public static final int BINARY_PREFIX_COMPRESSEDCompressed binary with shared prefixes- See Also:
-
SORTED_SET_WITH_ADDRESSES
public static final int SORTED_SET_WITH_ADDRESSESStandard storage for sorted set values with 1 level of indirection: docId -> address -> ord.- See Also:
-
SORTED_SET_SINGLE_VALUED_SORTED
public static final int SORTED_SET_SINGLE_VALUED_SORTEDSingle-valued sorted set values, encoded as sorted values, so no level of indirection: docId -> ord.- See Also:
-
-
Constructor Details
-
Lucene45DocValuesConsumer
public Lucene45DocValuesConsumer(SegmentWriteState state, String dataCodec, String dataExtension, String metaCodec, String metaExtension) throws IOException expert: Creates a new writer- Throws:
IOException
-
-
Method Details
-
addNumericField
Description copied from class:DocValuesConsumer
Writes numeric docvalues for a field.- Specified by:
addNumericField
in classDocValuesConsumer
- Parameters:
field
- field informationvalues
- Iterable of numeric values (one for each document).null
indicates a missing value.- Throws:
IOException
- if an I/O error occurred.
-
addBinaryField
Description copied from class:DocValuesConsumer
Writes binary docvalues for a field.- Specified by:
addBinaryField
in classDocValuesConsumer
- Parameters:
field
- field informationvalues
- Iterable of binary values (one for each document).null
indicates a missing value.- Throws:
IOException
- if an I/O error occurred.
-
addTermsDict
expert: writes a value dictionary for a sorted/sortedset field- Throws:
IOException
-
addSortedField
public void addSortedField(FieldInfo field, Iterable<BytesRef> values, Iterable<Number> docToOrd) throws IOException Description copied from class:DocValuesConsumer
Writes pre-sorted binary docvalues for a field.- Specified by:
addSortedField
in classDocValuesConsumer
- Parameters:
field
- field informationvalues
- Iterable of binary values in sorted order (deduplicated).docToOrd
- Iterable of ordinals (one for each document).-1
indicates a missing value.- Throws:
IOException
- if an I/O error occurred.
-
addSortedSetField
public void addSortedSetField(FieldInfo field, Iterable<BytesRef> values, Iterable<Number> docToOrdCount, Iterable<Number> ords) throws IOException Description copied from class:DocValuesConsumer
Writes pre-sorted set docvalues for a field- Specified by:
addSortedSetField
in classDocValuesConsumer
- Parameters:
field
- field informationvalues
- Iterable of binary values in sorted order (deduplicated).docToOrdCount
- Iterable of the number of values for each document. A zero ordinal count indicates a missing value.ords
- Iterable of ordinal occurrences (docToOrdCount*maxDoc total).- Throws:
IOException
- if an I/O error occurred.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-