Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class SepPostingsWriter

    Writes frq to .frq, docs to .doc, pos to .pos, payloads to .pyl, skip data to .skp

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    PostingsConsumer
    PostingsWriterBase
    SepPostingsWriter
    Implements
    IDisposable
    Inherited Members
    PostingsWriterBase.Dispose()
    PostingsConsumer.Merge(MergeState, IndexOptions, DocsEnum, FixedBitSet)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Codecs.Sep
    Assembly: Lucene.Net.Codecs.dll
    Syntax
    public sealed class SepPostingsWriter : PostingsWriterBase, IDisposable

    Constructors

    SepPostingsWriter(SegmentWriteState, Int32StreamFactory)

    Writes frq to .frq, docs to .doc, pos to .pos, payloads to .pyl, skip data to .skp

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public SepPostingsWriter(SegmentWriteState state, Int32StreamFactory factory)
    Parameters
    Type Name Description
    SegmentWriteState state
    Int32StreamFactory factory

    SepPostingsWriter(SegmentWriteState, Int32StreamFactory, int)

    Writes frq to .frq, docs to .doc, pos to .pos, payloads to .pyl, skip data to .skp

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public SepPostingsWriter(SegmentWriteState state, Int32StreamFactory factory, int skipInterval)
    Parameters
    Type Name Description
    SegmentWriteState state
    Int32StreamFactory factory
    int skipInterval

    Methods

    AddPosition(int, BytesRef, int, int)

    Add a new position & payload.

    Declaration
    public override void AddPosition(int position, BytesRef payload, int startOffset, int endOffset)
    Parameters
    Type Name Description
    int position
    BytesRef payload
    int startOffset
    int endOffset
    Overrides
    PostingsConsumer.AddPosition(int, BytesRef, int, int)

    Dispose(bool)

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

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    PostingsWriterBase.Dispose(bool)

    EncodeTerm(long[], DataOutput, FieldInfo, BlockTermState, bool)

    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 override void EncodeTerm(long[] longs, DataOutput output, FieldInfo fi, BlockTermState state, bool absolute)
    Parameters
    Type Name Description
    long[] longs
    DataOutput output
    FieldInfo fi
    BlockTermState state
    bool absolute
    Overrides
    PostingsWriterBase.EncodeTerm(long[], DataOutput, FieldInfo, BlockTermState, bool)

    FinishDoc()

    Called when we are done adding positions & payloads.

    Declaration
    public override void FinishDoc()
    Overrides
    Lucene.Net.Codecs.PostingsConsumer.FinishDoc()

    FinishTerm(BlockTermState)

    Called when we are done adding docs to this term.

    Declaration
    public override void FinishTerm(BlockTermState state)
    Parameters
    Type Name Description
    BlockTermState state
    Overrides
    Lucene.Net.Codecs.PostingsWriterBase.FinishTerm(Lucene.Net.Codecs.BlockTermState)

    Init(IndexOutput)

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

    Declaration
    public override void Init(IndexOutput termsOut)
    Parameters
    Type Name Description
    IndexOutput termsOut
    Overrides
    Lucene.Net.Codecs.PostingsWriterBase.Init(Lucene.Net.Store.IndexOutput)

    NewTermState()

    Return a newly created empty Lucene.Net.Index.TermState

    Declaration
    public override BlockTermState NewTermState()
    Returns
    Type Description
    BlockTermState
    Overrides
    Lucene.Net.Codecs.PostingsWriterBase.NewTermState()

    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 override int SetField(FieldInfo fieldInfo)
    Parameters
    Type Name Description
    FieldInfo fieldInfo
    Returns
    Type Description
    int
    Overrides
    Lucene.Net.Codecs.PostingsWriterBase.SetField(Lucene.Net.Index.FieldInfo)

    StartDoc(int, int)

    Adds a new doc in this term. If this returns null then we just skip consuming positions/payloads.

    Declaration
    public override void StartDoc(int docID, int termDocFreq)
    Parameters
    Type Name Description
    int docID
    int termDocFreq
    Overrides
    PostingsConsumer.StartDoc(int, int)

    StartTerm()

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

    Declaration
    public override void StartTerm()
    Overrides
    Lucene.Net.Codecs.PostingsWriterBase.StartTerm()

    Implements

    IDisposable
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.