Class FixedGapTermsIndexWriter
- java.lang.Object
-
- org.apache.lucene.codecs.blockterms.TermsIndexWriterBase
-
- org.apache.lucene.codecs.blockterms.FixedGapTermsIndexWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class FixedGapTermsIndexWriter extends TermsIndexWriterBase
Selects every Nth term as and index term, and hold term bytes (mostly) fully expanded in memory. This terms index supports seeking by ord. SeeVariableGapTermsIndexWriterfor a more memory efficient terms index that does not support seeking by ord.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classFixedGapTermsIndexWriter.SimpleFieldWriter-
Nested classes/interfaces inherited from class org.apache.lucene.codecs.blockterms.TermsIndexWriterBase
TermsIndexWriterBase.FieldWriter
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intBLOCKSIZE(package private) static java.lang.StringCODEC_NAMEstatic intDEFAULT_TERM_INDEX_INTERVALprivate java.util.List<FixedGapTermsIndexWriter.SimpleFieldWriter>fieldsprotected IndexOutputoutprivate inttermIndexInterval(package private) static java.lang.StringTERMS_INDEX_EXTENSIONExtension of terms index file(package private) static intVERSION_CURRENT(package private) static intVERSION_START
-
Constructor Summary
Constructors Constructor Description FixedGapTermsIndexWriter(SegmentWriteState state)FixedGapTermsIndexWriter(SegmentWriteState state, int termIndexInterval)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TermsIndexWriterBase.FieldWriteraddField(FieldInfo field, long termsFilePointer)voidclose()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 Detail
-
out
protected IndexOutput out
-
TERMS_INDEX_EXTENSION
static final java.lang.String TERMS_INDEX_EXTENSION
Extension of terms index file- See Also:
- Constant Field Values
-
CODEC_NAME
static final java.lang.String CODEC_NAME
- See Also:
- Constant Field Values
-
VERSION_START
static final int VERSION_START
- See Also:
- Constant Field Values
-
VERSION_CURRENT
static final int VERSION_CURRENT
- See Also:
- Constant Field Values
-
BLOCKSIZE
static final int BLOCKSIZE
- See Also:
- Constant Field Values
-
termIndexInterval
private final int termIndexInterval
-
DEFAULT_TERM_INDEX_INTERVAL
public static final int DEFAULT_TERM_INDEX_INTERVAL
- See Also:
- Constant Field Values
-
fields
private final java.util.List<FixedGapTermsIndexWriter.SimpleFieldWriter> fields
-
-
Constructor Detail
-
FixedGapTermsIndexWriter
public FixedGapTermsIndexWriter(SegmentWriteState state) throws java.io.IOException
- Throws:
java.io.IOException
-
FixedGapTermsIndexWriter
public FixedGapTermsIndexWriter(SegmentWriteState state, int termIndexInterval) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
addField
public TermsIndexWriterBase.FieldWriter addField(FieldInfo field, long termsFilePointer)
- Specified by:
addFieldin classTermsIndexWriterBase
-
indexedTermPrefixLength
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.
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
writeTrailer
private void writeTrailer(long dirStart) throws java.io.IOException- Throws:
java.io.IOException
-
-