Class VersionBlockTreeTermsWriter
- java.lang.Object
-
- org.apache.lucene.codecs.FieldsConsumer
-
- org.apache.lucene.sandbox.codecs.idversion.VersionBlockTreeTermsWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class VersionBlockTreeTermsWriter extends FieldsConsumer
This is just likeLucene90BlockTreeTermsWriter, except it also stores a version per term, and adds a method to its TermsEnum implementation to seekExact only if the version is >= the specified version. The version is added to the terms index to avoid seeking if no term in the block has a high enough version. The term blocks file is .tiv and the terms index extension is .tipv.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_BLOCK_SIZESuggested default value for themaxItemsInBlockparameter toVersionBlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int).static intDEFAULT_MIN_BLOCK_SIZESuggested default value for theminItemsInBlockparameter toVersionBlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int).static intVERSION_CURRENTCurrent terms format.static intVERSION_STARTInitial terms format.
-
Constructor Summary
Constructors Constructor Description VersionBlockTreeTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter, int minItemsInBlock, int maxItemsInBlock)Create a new writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidwrite(Fields fields, NormsProducer norms)-
Methods inherited from class org.apache.lucene.codecs.FieldsConsumer
merge
-
-
-
-
Field Detail
-
DEFAULT_MIN_BLOCK_SIZE
public static final int DEFAULT_MIN_BLOCK_SIZE
Suggested default value for theminItemsInBlockparameter toVersionBlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int).- See Also:
- Constant Field Values
-
DEFAULT_MAX_BLOCK_SIZE
public static final int DEFAULT_MAX_BLOCK_SIZE
Suggested default value for themaxItemsInBlockparameter toVersionBlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int).- See Also:
- Constant Field Values
-
VERSION_START
public static final int VERSION_START
Initial terms format.- See Also:
- Constant Field Values
-
VERSION_CURRENT
public static final int VERSION_CURRENT
Current terms format.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VersionBlockTreeTermsWriter
public VersionBlockTreeTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter, int minItemsInBlock, int maxItemsInBlock) throws IOException
Create a new writer. The number of items (terms or sub-blocks) per block will aim to be between minItemsPerBlock and maxItemsPerBlock, though in some cases the blocks may be smaller than the min.- Throws:
IOException
-
-
Method Detail
-
write
public void write(Fields fields, NormsProducer norms) throws IOException
- Specified by:
writein classFieldsConsumer- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classFieldsConsumer- Throws:
IOException
-
-