- Direct Known Subclasses:
Class that plugs into term dictionaries, such as
Lucene90BlockTreeTermsWriter, and handles writing postings.
- See Also:
- WARNING: This API is experimental and might change in incompatible ways in the next release.
Method SummaryModifier and TypeMethodDescription
abstract voidEncode metadata as long and byte.
abstract voidCalled once after startup, before any terms have been added.
abstract voidSets the current field for writing.
PostingsWriterBaseprotected PostingsWriterBase()Sole constructor. (For invocation by subclass constructors, typically implicit.)
initCalled once after startup, before any terms have been added. Implementations typically write a header to the provided
writeTermpublic abstract BlockTermState writeTerm
(BytesRef term, TermsEnum termsEnum, FixedBitSet docsSeen, NormsProducer norms) throws IOExceptionWrite all postings for one term; use the provided
TermsEnumto pull a
PostingsEnum. This method should not re-position the
TermsEnum! It is already positioned on the term that should be written. This method must set the bit in the provided
FixedBitSetfor every docID written. If no docs were written, this method should return null, and the terms dict will skip the term.
encodeTermpublic abstract void encodeTerm
(DataOutput out, FieldInfo fieldInfo, BlockTermState state, boolean absolute) throws IOExceptionEncode metadata as long and byte.
absolutecontrols whether current term is delta encoded according to latest term. Usually elements in
longsare file pointers, so each one always increases when a new term is consumed.
outis used to write generic bytes, which are not monotonic.
setFieldpublic abstract void setField
(FieldInfo fieldInfo)Sets the current field for writing.
closepublic abstract void close() throws IOException