Show / Hide Table of Contents

    Class PostingsWriterBase

    Extension of PostingsConsumer to support pluggable term dictionaries.

    This class contains additional hooks to interact with the provided term dictionaries such as BlockTreeTermsWriter. If you want to re-use an existing implementation and are only interested in customizing the format of the postings list, extend this class instead.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    PostingsConsumer
    PostingsWriterBase
    Lucene41PostingsWriter
    Implements
    IDisposable
    Inherited Members
    PostingsConsumer.StartDoc(Int32, Int32)
    PostingsConsumer.AddPosition(Int32, BytesRef, Int32, Int32)
    PostingsConsumer.FinishDoc()
    PostingsConsumer.Merge(MergeState, IndexOptions, DocsEnum, FixedBitSet)
    Namespace: Lucene.Net.Codecs
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class PostingsWriterBase : PostingsConsumer, IDisposable

    Constructors

    | Improve this Doc View Source

    PostingsWriterBase()

    Sole constructor. (For invocation by subclass constructors, typically implicit.)

    Declaration
    protected PostingsWriterBase()

    Methods

    | Improve this Doc View Source

    Dispose()

    Disposes all resources used by this object.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Implementations must override and should dispose all resources used by this instance.

    Declaration
    protected abstract void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    | Improve this Doc View Source

    EncodeTerm(Int64[], DataOutput, FieldInfo, BlockTermState, Boolean)

    Encode metadata as long[] and byte[]. absolute controls whether current term is delta encoded according to latest term. Usually elements in longs are file pointers, so each one always increases when a new term is consumed. out is used to write generic bytes, which are not monotonic.

    NOTE: sometimes long[] might contain "don't care" values that are unused, e.g. the pointer to postings list may not be defined for some terms but is defined for others, if it is designed to inline some postings data in term dictionary. In this case, the postings writer should always use the last value, so that each element in metadata long[] remains monotonic.

    Declaration
    public abstract void EncodeTerm(long[] longs, DataOutput out, FieldInfo fieldInfo, BlockTermState state, bool absolute)
    Parameters
    Type Name Description
    System.Int64[] longs
    DataOutput out
    FieldInfo fieldInfo
    BlockTermState state
    System.Boolean absolute
    | Improve this Doc View Source

    FinishTerm(BlockTermState)

    Finishes the current term. The provided BlockTermState contains the term's summary statistics, and will holds metadata from PBF when returned.

    Declaration
    public abstract void FinishTerm(BlockTermState state)
    Parameters
    Type Name Description
    BlockTermState state
    | Improve this Doc View Source

    Init(IndexOutput)

    Called once after startup, before any terms have been added. Implementations typically write a header to the provided termsOut.

    Declaration
    public abstract void Init(IndexOutput termsOut)
    Parameters
    Type Name Description
    IndexOutput termsOut
    | Improve this Doc View Source

    NewTermState()

    Return a newly created empty TermState

    Declaration
    public abstract BlockTermState NewTermState()
    Returns
    Type Description
    BlockTermState
    | Improve this Doc View Source

    SetField(FieldInfo)

    Sets the current field for writing, and returns the fixed length of long[] metadata (which is fixed per field), called when the writing switches to another field.

    Declaration
    public abstract int SetField(FieldInfo fieldInfo)
    Parameters
    Type Name Description
    FieldInfo fieldInfo
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    StartTerm()

    Start a new term. Note that a matching call to FinishTerm(BlockTermState) is done, only if the term has at least one document.

    Declaration
    public abstract void StartTerm()

    Implements

    IDisposable

    See Also

    PostingsReaderBase
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)