Class STUniformSplitTermsWriter
- java.lang.Object
-
- org.apache.lucene.codecs.FieldsConsumer
-
- org.apache.lucene.codecs.uniformsplit.UniformSplitTermsWriter
-
- org.apache.lucene.codecs.uniformsplit.sharedterms.STUniformSplitTermsWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class STUniformSplitTermsWriter extends UniformSplitTermsWriter
ExtendsUniformSplitTermsWriterby 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 filecontains all the term blocks for all fields. Each block line, for a single term, may have multiple fieldsTermState. The block file also contains the fields metadata at the end of the file.The
dictionary filecontains a single trie (FSTbytes) 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
FieldsConsumerrequires a custommerge(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.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.codecs.uniformsplit.UniformSplitTermsWriter
blockEncoder, blockOutput, DEFAULT_DELTA_NUM_LINES, DEFAULT_TARGET_NUM_BLOCK_LINES, deltaNumLines, dictionaryOutput, fieldInfos, fieldMetadataWriter, MAX_NUM_BLOCK_LINES, maxDoc, postingsWriter, targetNumBlockLines
-
-
Constructor Summary
Constructors Modifier Constructor Description STUniformSplitTermsWriter(PostingsWriterBase postingsWriter, SegmentWriteState state, int targetNumBlockLines, int deltaNumLines, BlockEncoder blockEncoder)protectedSTUniformSplitTermsWriter(PostingsWriterBase postingsWriter, SegmentWriteState state, int targetNumBlockLines, int deltaNumLines, BlockEncoder blockEncoder, FieldMetadata.Serializer fieldMetadataWriter, String codecName, int versionCurrent, String termsBlocksExtension, String dictionaryExtension)STUniformSplitTermsWriter(PostingsWriterBase postingsWriter, SegmentWriteState state, BlockEncoder blockEncoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmerge(MergeState mergeState, NormsProducer normsProducer)voidwrite(Fields fields, NormsProducer normsProducer)protected voidwriteDictionary(int fieldsNumber, IndexDictionary.Builder dictionaryBuilder)-
Methods inherited from class org.apache.lucene.codecs.uniformsplit.UniformSplitTermsWriter
close, validateSettings, writeDictionary, writeEncodedFieldsMetadata, writeFieldsMetadata, writeFieldTerms, writePostingLine, writeUnencodedFieldsMetadata
-
-
-
-
Constructor Detail
-
STUniformSplitTermsWriter
public STUniformSplitTermsWriter(PostingsWriterBase postingsWriter, SegmentWriteState state, BlockEncoder blockEncoder) throws IOException
- Throws:
IOException
-
STUniformSplitTermsWriter
public STUniformSplitTermsWriter(PostingsWriterBase postingsWriter, SegmentWriteState state, int targetNumBlockLines, int deltaNumLines, BlockEncoder blockEncoder) throws IOException
- Throws:
IOException
-
STUniformSplitTermsWriter
protected STUniformSplitTermsWriter(PostingsWriterBase postingsWriter, SegmentWriteState state, int targetNumBlockLines, int deltaNumLines, BlockEncoder blockEncoder, FieldMetadata.Serializer fieldMetadataWriter, String codecName, int versionCurrent, String termsBlocksExtension, String dictionaryExtension) throws IOException
- Throws:
IOException
-
-
Method Detail
-
write
public void write(Fields fields, NormsProducer normsProducer) throws IOException
- Overrides:
writein classUniformSplitTermsWriter- Throws:
IOException
-
writeDictionary
protected void writeDictionary(int fieldsNumber, IndexDictionary.Builder dictionaryBuilder) throws IOException- Throws:
IOException
-
merge
public void merge(MergeState mergeState, NormsProducer normsProducer) throws IOException
- Overrides:
mergein classFieldsConsumer- Throws:
IOException
-
-