Class VersionBlockTreeTermsWriter
java.lang.Object
org.apache.lucene.codecs.FieldsConsumer
org.apache.lucene.sandbox.codecs.idversion.VersionBlockTreeTermsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
This is just like
Lucene90BlockTreeTermsWriter, 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
FieldsModifier and TypeFieldDescriptionstatic final intSuggested default value for themaxItemsInBlockparameter toVersionBlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int).static final intSuggested default value for theminItemsInBlockparameter toVersionBlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int).static final intCurrent terms format.static final intInitial terms format. -
Constructor Summary
ConstructorsConstructorDescriptionVersionBlockTreeTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter, int minItemsInBlock, int maxItemsInBlock) Create a new writer. -
Method Summary
Methods inherited from class org.apache.lucene.codecs.FieldsConsumer
merge
-
Field Details
-
DEFAULT_MIN_BLOCK_SIZE
public static final int DEFAULT_MIN_BLOCK_SIZESuggested default value for theminItemsInBlockparameter toVersionBlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int).- See Also:
-
DEFAULT_MAX_BLOCK_SIZE
public static final int DEFAULT_MAX_BLOCK_SIZESuggested default value for themaxItemsInBlockparameter toVersionBlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int).- See Also:
-
VERSION_START
public static final int VERSION_STARTInitial terms format.- See Also:
-
VERSION_CURRENT
public static final int VERSION_CURRENTCurrent terms format.- See Also:
-
-
Constructor Details
-
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 Details
-
write
- Specified by:
writein classFieldsConsumer- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classFieldsConsumer- Throws:
IOException
-