java.lang.Object
org.apache.lucene.codecs.FieldsConsumer
org.apache.lucene.codecs.blockterms.BlockTermsWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
Writes terms dict, block-encoding (column stride) each term's metadata for each set of terms
between two index terms.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
(package private) FieldInfo
(package private) final FieldInfos
private final List<BlockTermsWriter.FieldMetaData>
private final int
protected IndexOutput
(package private) final PostingsWriterBase
(package private) static final String
Extension of terms fileprivate final TermsIndexWriterBase
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionBlockTermsWriter
(TermsIndexWriterBase termsIndexWriter, SegmentWriteState state, PostingsWriterBase postingsWriter) -
Method Summary
Modifier and TypeMethodDescriptionprivate BlockTermsWriter.TermsWriter
void
close()
void
write
(Fields fields, NormsProducer norms) Write all fields, terms and postings.private void
writeTrailer
(long dirStart) Methods inherited from class org.apache.lucene.codecs.FieldsConsumer
merge
-
Field Details
-
CODEC_NAME
- See Also:
-
VERSION_START
public static final int VERSION_START- See Also:
-
VERSION_CURRENT
public static final int VERSION_CURRENT- See Also:
-
TERMS_EXTENSION
Extension of terms file- See Also:
-
out
-
postingsWriter
-
fieldInfos
-
currentField
FieldInfo currentField -
termsIndexWriter
-
maxDoc
private final int maxDoc -
fields
-
-
Constructor Details
-
BlockTermsWriter
public BlockTermsWriter(TermsIndexWriterBase termsIndexWriter, SegmentWriteState state, PostingsWriterBase postingsWriter) throws IOException - Throws:
IOException
-
-
Method Details
-
write
Description copied from class:FieldsConsumer
Write all fields, terms and postings. This the "pull" API, allowing you to iterate more than once over the postings, somewhat analogous to using a DOM API to traverse an XML tree.Notes:
- You must compute index statistics, including each Term's docFreq and totalTermFreq, as well as the summary sumTotalTermFreq, sumTotalDocFreq and docCount.
- You must skip terms that have no docs and fields that have no terms, even though the provided Fields API will expose them; this typically requires lazily writing the field or term until you've actually seen the first term or document.
- The provided Fields instance is limited: you cannot call any methods that return statistics/counts; you cannot pass a non-null live docs when pulling docs/positions enums.
- Specified by:
write
in classFieldsConsumer
- Throws:
IOException
-
addField
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classFieldsConsumer
- Throws:
IOException
-
writeTrailer
- Throws:
IOException
-