Show / Hide Table of Contents

    Class PostingsConsumer

    Abstract API that consumes postings for an individual term.

    The lifecycle is:

    1. PostingsConsumer is returned for each term by StartTerm(BytesRef).
    2. StartDoc(Int32, Int32) is called for each document where the term occurs, specifying id and term frequency for that document.
    3. If positions are enabled for the field, then AddPosition(Int32, BytesRef, Int32, Int32) will be called for each occurrence in the document.
    4. FinishDoc() is called when the producer is done adding positions to the document.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    PostingsConsumer
    PostingsWriterBase
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Codecs
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class PostingsConsumer

    Constructors

    | Improve this Doc View Source

    PostingsConsumer()

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

    Declaration
    protected PostingsConsumer()

    Methods

    | Improve this Doc View Source

    AddPosition(Int32, BytesRef, Int32, Int32)

    Add a new position & payload, and start/end offset. A null payload means no payload; a non-null payload with zero length also means no payload. Caller may reuse the BytesRef for the payload between calls (method must fully consume the payload). startOffset and endOffset will be -1 when offsets are not indexed.

    Declaration
    public abstract void AddPosition(int position, BytesRef payload, int startOffset, int endOffset)
    Parameters
    Type Name Description
    System.Int32 position
    BytesRef payload
    System.Int32 startOffset
    System.Int32 endOffset
    | Improve this Doc View Source

    FinishDoc()

    Called when we are done adding positions & payloads for each doc.

    Declaration
    public abstract void FinishDoc()
    | Improve this Doc View Source

    Merge(MergeState, IndexOptions, DocsEnum, FixedBitSet)

    Default merge impl: append documents, mapping around deletes.

    Declaration
    public virtual TermStats Merge(MergeState mergeState, IndexOptions indexOptions, DocsEnum postings, FixedBitSet visitedDocs)
    Parameters
    Type Name Description
    MergeState mergeState
    IndexOptions indexOptions
    DocsEnum postings
    FixedBitSet visitedDocs
    Returns
    Type Description
    TermStats
    | Improve this Doc View Source

    StartDoc(Int32, Int32)

    Adds a new doc in this term. freq will be -1 when term frequencies are omitted for the field.

    Declaration
    public abstract void StartDoc(int docId, int freq)
    Parameters
    Type Name Description
    System.Int32 docId
    System.Int32 freq

    Extension Methods

    Number.IsNumber(Object)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2019 Licensed to the Apache Software Foundation (ASF)