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 class
Sets an index term when docFreq >= docFreqThresh, or every interval terms.static final class
Same policy asFixedGapTermsIndexWriter
private class
static class
Hook 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 String
private final FieldInfos
private final List<VariableGapTermsIndexWriter.FSTFieldWriter>
protected IndexOutput
private final VariableGapTermsIndexWriter.IndexTermSelector
(package private) static final String
Extension 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 TypeMethodDescriptionvoid
close()
protected int
indexedTermPrefixLength
(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 void
writeTrailer
(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:
addField
in 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
-