public final class Lucene70DocValuesFormat extends DocValuesFormat
Documents that have a value for the field are encoded in a way that it is always possible to know the ordinal of the current document in the set of documents that have a value. For instance, say the set of documents that have a value for the field is {1, 5, 6, 11}. When the iterator is on 6, it knows that this is the 3rd item of the set. This way, values can be stored densely and accessed based on their index at search time. If all documents in a segment have a value for the field, the index is the same as the doc ID, so this case is encoded implicitly and is very fast at query time. On the other hand if some documents are missing a value for the field then the set of documents that have a value is encoded into blocks. All doc IDs that share the same upper 16 bits are encoded into the same block with the following strategies:
shorts
while the upper
16 bits are given by the block ID.
ntz
operations while the index is computed by
accumulating the bit counts
of the visited longs.
index sorting
.
Then the five per-document value types (Numeric,Binary,Sorted,SortedSet,SortedNumeric) are encoded using the following strategies:
DirectWriter
.
SmallFloat
),
a lookup table is written instead. Each per-document entry is instead the ordinal
to this table, and those ordinals are compressed with bitpacking (DirectWriter
).
docID * length
).
Files:
Modifier and Type | Field and Description |
---|---|
(package private) static byte |
BINARY |
(package private) static java.lang.String |
DATA_CODEC |
(package private) static java.lang.String |
DATA_EXTENSION |
(package private) static int |
DIRECT_MONOTONIC_BLOCK_SHIFT |
(package private) static java.lang.String |
META_CODEC |
(package private) static java.lang.String |
META_EXTENSION |
(package private) static byte |
NUMERIC |
(package private) static int |
NUMERIC_BLOCK_SHIFT |
(package private) static int |
NUMERIC_BLOCK_SIZE |
(package private) static byte |
SORTED |
(package private) static byte |
SORTED_NUMERIC |
(package private) static byte |
SORTED_SET |
(package private) static int |
TERMS_DICT_BLOCK_MASK |
(package private) static int |
TERMS_DICT_BLOCK_SHIFT |
(package private) static int |
TERMS_DICT_BLOCK_SIZE |
(package private) static int |
TERMS_DICT_REVERSE_INDEX_MASK |
(package private) static int |
TERMS_DICT_REVERSE_INDEX_SHIFT |
(package private) static int |
TERMS_DICT_REVERSE_INDEX_SIZE |
(package private) static int |
VERSION_CURRENT |
(package private) static int |
VERSION_START |
Constructor and Description |
---|
Lucene70DocValuesFormat()
Sole Constructor
|
Modifier and Type | Method and Description |
---|---|
DocValuesConsumer |
fieldsConsumer(SegmentWriteState state)
Returns a
DocValuesConsumer to write docvalues to the
index. |
DocValuesProducer |
fieldsProducer(SegmentReadState state)
Returns a
DocValuesProducer to read docvalues from the index. |
availableDocValuesFormats, forName, getName, reloadDocValuesFormats, toString
static final java.lang.String DATA_CODEC
static final java.lang.String DATA_EXTENSION
static final java.lang.String META_CODEC
static final java.lang.String META_EXTENSION
static final int VERSION_START
static final int VERSION_CURRENT
static final byte NUMERIC
static final byte BINARY
static final byte SORTED
static final byte SORTED_SET
static final byte SORTED_NUMERIC
static final int DIRECT_MONOTONIC_BLOCK_SHIFT
static final int NUMERIC_BLOCK_SHIFT
static final int NUMERIC_BLOCK_SIZE
static final int TERMS_DICT_BLOCK_SHIFT
static final int TERMS_DICT_BLOCK_SIZE
static final int TERMS_DICT_BLOCK_MASK
static final int TERMS_DICT_REVERSE_INDEX_SHIFT
static final int TERMS_DICT_REVERSE_INDEX_SIZE
static final int TERMS_DICT_REVERSE_INDEX_MASK
public DocValuesConsumer fieldsConsumer(SegmentWriteState state) throws java.io.IOException
DocValuesFormat
DocValuesConsumer
to write docvalues to the
index.fieldsConsumer
in class DocValuesFormat
java.io.IOException
public DocValuesProducer fieldsProducer(SegmentReadState state) throws java.io.IOException
DocValuesFormat
DocValuesProducer
to read docvalues from the index.
NOTE: by the time this call returns, it must hold open any files it will need to use; else, those files may be deleted. Additionally, required files may be deleted during the execution of this call before there is a chance to open them. Under these circumstances an IOException should be thrown by the implementation. IOExceptions are expected and will automatically cause a retry of the segment opening logic with the newly revised segments.
fieldsProducer
in class DocValuesFormat
java.io.IOException