Module org.apache.lucene.codecs
Class VariableGapTermsIndexWriter
java.lang.Object
org.apache.lucene.codecs.blockterms.TermsIndexWriterBase
org.apache.lucene.codecs.blockterms.VariableGapTermsIndexWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
Selects index terms according to provided pluggable
VariableGapTermsIndexWriter.IndexTermSelector, and stores them in
a prefix trie that's loaded entirely in RAM stored as an FST. This terms index only supports
unsigned byte term sort order (unicode codepoint order when the bytes are UTF8).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSets an index term when docFreq >= docFreqThresh, or every interval terms.static final classSame policy asFixedGapTermsIndexWriterprivate classstatic classHook for selecting which terms should be placed in the terms index.Nested classes/interfaces inherited from class org.apache.lucene.codecs.blockterms.TermsIndexWriterBase
TermsIndexWriterBase.FieldWriter -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Stringprivate final FieldInfosprivate final List<VariableGapTermsIndexWriter.FSTFieldWriter> protected IndexOutputprivate final VariableGapTermsIndexWriter.IndexTermSelector(package private) static final StringExtension of terms index file(package private) static final int(package private) static final int -
Constructor Summary
ConstructorsConstructorDescriptionVariableGapTermsIndexWriter(SegmentWriteState state, VariableGapTermsIndexWriter.IndexTermSelector policy) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected intindexedTermPrefixLength(BytesRef priorTerm, BytesRef indexedTerm) NOTE: if your codec does not sort in unicode code point order, you must override this method, to simply return indexedTerm.length.private voidwriteTrailer(long dirStart)
-
Field Details
-
out
-
TERMS_INDEX_EXTENSION
Extension of terms index file- See Also:
-
CODEC_NAME
- See Also:
-
VERSION_START
static final int VERSION_START- See Also:
-
VERSION_CURRENT
static final int VERSION_CURRENT- See Also:
-
fields
-
fieldInfos
-
policy
-
-
Constructor Details
-
VariableGapTermsIndexWriter
public VariableGapTermsIndexWriter(SegmentWriteState state, VariableGapTermsIndexWriter.IndexTermSelector policy) throws IOException - Throws:
IOException
-
-
Method Details
-
addField
public TermsIndexWriterBase.FieldWriter addField(FieldInfo field, long termsFilePointer) throws IOException - Specified by:
addFieldin classTermsIndexWriterBase- Throws:
IOException
-
indexedTermPrefixLength
NOTE: if your codec does not sort in unicode code point order, you must override this method, to simply return indexedTerm.length. -
close
- Throws:
IOException
-
writeTrailer
- Throws:
IOException
-