public class STUniformSplitTermsWriter extends UniformSplitTermsWriter
UniformSplitTermsWriter by sharing all the fields terms
in the same dictionary and by writing all the fields of a term in the same
block line.
The block file
contains all the term blocks for all fields. Each block line, for a single term,
may have multiple fields org.apache.lucene.index.TermState. The
block file also contains the fields metadata at the end of the file.
The dictionary file
contains a single trie (org.apache.lucene.util.fst.FST bytes) for all
fields.
This structure is adapted when there are lots of fields. In this case the shared-terms dictionary trie is much smaller.
This org.apache.lucene.codecs.FieldsConsumer requires a custom
merge(MergeState, NormsProducer) method for efficiency. The
regular merge would scan all the fields sequentially, which internally would
scan the whole shared-terms dictionary as many times as there are fields.
Whereas the custom merge directly scans the internal shared-terms dictionary
of all segments to merge, thus scanning once whatever the number of fields is.
| Modifier and Type | Class and Description |
|---|---|
protected class |
STUniformSplitTermsWriter.SegmentPostings |
blockEncoder, blockOutput, DEFAULT_DELTA_NUM_LINES, DEFAULT_TARGET_NUM_BLOCK_LINES, deltaNumLines, dictionaryOutput, fieldInfos, MAX_NUM_BLOCK_LINES, maxDoc, postingsWriter, targetNumBlockLines| Modifier | Constructor and Description |
|---|---|
|
STUniformSplitTermsWriter(PostingsWriterBase postingsWriter,
SegmentWriteState state,
BlockEncoder blockEncoder) |
|
STUniformSplitTermsWriter(PostingsWriterBase postingsWriter,
SegmentWriteState state,
int targetNumBlockLines,
int deltaNumLines,
BlockEncoder blockEncoder) |
protected |
STUniformSplitTermsWriter(PostingsWriterBase postingsWriter,
SegmentWriteState state,
int targetNumBlockLines,
int deltaNumLines,
BlockEncoder blockEncoder,
java.lang.String codecName,
int versionCurrent,
java.lang.String termsBlocksExtension,
java.lang.String dictionaryExtension) |
| Modifier and Type | Method and Description |
|---|---|
void |
merge(MergeState mergeState,
NormsProducer normsProducer) |
void |
write(Fields fields,
NormsProducer normsProducer) |
protected void |
writeDictionary(int fieldsNumber,
IndexDictionary.Builder dictionaryBuilder) |
close, validateSettings, writeDictionary, writeFieldsMetadata, writeFieldTerms, writePostingLinepublic STUniformSplitTermsWriter(PostingsWriterBase postingsWriter,
SegmentWriteState state,
BlockEncoder blockEncoder)
throws java.io.IOException
java.io.IOExceptionpublic STUniformSplitTermsWriter(PostingsWriterBase postingsWriter,
SegmentWriteState state,
int targetNumBlockLines,
int deltaNumLines,
BlockEncoder blockEncoder)
throws java.io.IOException
java.io.IOExceptionprotected STUniformSplitTermsWriter(PostingsWriterBase postingsWriter,
SegmentWriteState state,
int targetNumBlockLines,
int deltaNumLines,
BlockEncoder blockEncoder,
java.lang.String codecName,
int versionCurrent,
java.lang.String termsBlocksExtension,
java.lang.String dictionaryExtension)
throws java.io.IOException
java.io.IOExceptionpublic void write(Fields fields,
NormsProducer normsProducer)
throws java.io.IOException
write in class UniformSplitTermsWriterjava.io.IOExceptionprotected void writeDictionary(int fieldsNumber,
IndexDictionary.Builder dictionaryBuilder)
throws java.io.IOException
java.io.IOExceptionpublic void merge(MergeState mergeState,
NormsProducer normsProducer)
throws java.io.IOException
java.io.IOExceptionData In Motion GmbH all rights reserved