Class Lucene45DocValuesConsumer
- java.lang.Object
-
- org.apache.lucene.codecs.DocValuesConsumer
-
- org.apache.lucene.codecs.lucene45.Lucene45DocValuesConsumer
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class Lucene45DocValuesConsumer extends DocValuesConsumer implements java.io.Closeable
writer forLucene45DocValuesFormat
-
-
Field Summary
Fields Modifier and Type Field Description static int
BINARY_FIXED_UNCOMPRESSED
Uncompressed binary, written directly (fixed length).static int
BINARY_PREFIX_COMPRESSED
Compressed binary with shared prefixesstatic int
BINARY_VARIABLE_UNCOMPRESSED
Uncompressed binary, written directly (variable length).static int
DELTA_COMPRESSED
Compressed using packed blocks of ints.static int
GCD_COMPRESSED
Compressed by computing the GCD.static int
SORTED_SET_SINGLE_VALUED_SORTED
Single-valued sorted set values, encoded as sorted values, so no level of indirection: docId -> ord.static int
SORTED_SET_WITH_ADDRESSES
Standard storage for sorted set values with 1 level of indirection: docId -> address -> ord.static int
TABLE_COMPRESSED
Compressed by giving IDs to unique values.
-
Constructor Summary
Constructors Constructor Description Lucene45DocValuesConsumer(SegmentWriteState state, java.lang.String dataCodec, java.lang.String dataExtension, java.lang.String metaCodec, java.lang.String metaExtension)
expert: Creates a new writer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBinaryField(FieldInfo field, java.lang.Iterable<BytesRef> values)
Writes binary docvalues for a field.void
addNumericField(FieldInfo field, java.lang.Iterable<java.lang.Number> values)
Writes numeric docvalues for a field.void
addSortedField(FieldInfo field, java.lang.Iterable<BytesRef> values, java.lang.Iterable<java.lang.Number> docToOrd)
Writes pre-sorted binary docvalues for a field.void
addSortedSetField(FieldInfo field, java.lang.Iterable<BytesRef> values, java.lang.Iterable<java.lang.Number> docToOrdCount, java.lang.Iterable<java.lang.Number> ords)
Writes pre-sorted set docvalues for a fieldvoid
close()
-
Methods inherited from class org.apache.lucene.codecs.DocValuesConsumer
mergeBinaryField, mergeNumericField, mergeSortedField, mergeSortedSetField
-
-
-
-
Field Detail
-
DELTA_COMPRESSED
public static final int DELTA_COMPRESSED
Compressed using packed blocks of ints.- See Also:
- Constant Field Values
-
GCD_COMPRESSED
public static final int GCD_COMPRESSED
Compressed by computing the GCD.- See Also:
- Constant Field Values
-
TABLE_COMPRESSED
public static final int TABLE_COMPRESSED
Compressed by giving IDs to unique values.- See Also:
- Constant Field Values
-
BINARY_FIXED_UNCOMPRESSED
public static final int BINARY_FIXED_UNCOMPRESSED
Uncompressed binary, written directly (fixed length).- See Also:
- Constant Field Values
-
BINARY_VARIABLE_UNCOMPRESSED
public static final int BINARY_VARIABLE_UNCOMPRESSED
Uncompressed binary, written directly (variable length).- See Also:
- Constant Field Values
-
BINARY_PREFIX_COMPRESSED
public static final int BINARY_PREFIX_COMPRESSED
Compressed binary with shared prefixes- See Also:
- Constant Field Values
-
SORTED_SET_WITH_ADDRESSES
public static final int SORTED_SET_WITH_ADDRESSES
Standard storage for sorted set values with 1 level of indirection: docId -> address -> ord.- See Also:
- Constant Field Values
-
SORTED_SET_SINGLE_VALUED_SORTED
public static final int SORTED_SET_SINGLE_VALUED_SORTED
Single-valued sorted set values, encoded as sorted values, so no level of indirection: docId -> ord.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Lucene45DocValuesConsumer
public Lucene45DocValuesConsumer(SegmentWriteState state, java.lang.String dataCodec, java.lang.String dataExtension, java.lang.String metaCodec, java.lang.String metaExtension) throws java.io.IOException
expert: Creates a new writer- Throws:
java.io.IOException
-
-
Method Detail
-
addNumericField
public void addNumericField(FieldInfo field, java.lang.Iterable<java.lang.Number> values) throws java.io.IOException
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:
java.io.IOException
- if an I/O error occurred.
-
addBinaryField
public void addBinaryField(FieldInfo field, java.lang.Iterable<BytesRef> values) throws java.io.IOException
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:
java.io.IOException
- if an I/O error occurred.
-
addSortedField
public void addSortedField(FieldInfo field, java.lang.Iterable<BytesRef> values, java.lang.Iterable<java.lang.Number> docToOrd) throws java.io.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:
java.io.IOException
- if an I/O error occurred.
-
addSortedSetField
public void addSortedSetField(FieldInfo field, java.lang.Iterable<BytesRef> values, java.lang.Iterable<java.lang.Number> docToOrdCount, java.lang.Iterable<java.lang.Number> ords) throws java.io.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:
java.io.IOException
- if an I/O error occurred.
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-