Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class Lucene40LiveDocsFormat

    Lucene 4.0 Live Documents Format.

    The .del file is optional, and only exists when a segment contains deletions.

    Although per-segment, this file is maintained exterior to compound segment files.

    Deletions (.del) --> Format,Header,ByteCount,BitCount, Bits | DGaps (depending on Format)

    • Format,ByteSize,BitCount --> Uint32 (WriteInt32(int))
    • Bits --> < Byte (WriteByte(byte)) > ByteCount
    • DGaps --> <DGap,NonOnesByte> NonzeroBytesCount
    • DGap --> VInt (WriteVInt32(int))
    • NonOnesByte --> Byte(WriteByte(byte))
    • Header --> CodecHeader (WriteHeader(DataOutput, string, int))

    Format is 1: indicates cleared DGaps.

    ByteCount indicates the number of bytes in Bits. It is typically (SegSize/8)+1.

    BitCount indicates the number of bits that are currently set in Bits.

    Bits contains one bit for each document indexed. When the bit corresponding to a document number is cleared, that document is marked as deleted. Bit ordering is from least to most significant. Thus, if Bits contains two bytes, 0x00 and 0x02, then document 9 is marked as alive (not deleted).

    DGaps represents sparse bit-vectors more efficiently than Bits. It is made of DGaps on indexes of nonOnes bytes in Bits, and the nonOnes bytes themselves. The number of nonOnes bytes in Bits (NonOnesBytesCount) is not stored.

    For example, if there are 8000 bits and only bits 10,12,32 are cleared, DGaps would be used:

    (VInt) 1 , (byte) 20 , (VInt) 3 , (Byte) 1

    Inheritance
    object
    LiveDocsFormat
    Lucene40LiveDocsFormat
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Codecs.Lucene40
    Assembly: Lucene.Net.dll
    Syntax
    public class Lucene40LiveDocsFormat : LiveDocsFormat

    Constructors

    Lucene40LiveDocsFormat()

    Sole constructor.

    Declaration
    public Lucene40LiveDocsFormat()

    Methods

    Files(SegmentCommitInfo, ICollection<string>)

    Records all files in use by this SegmentCommitInfo into the files argument.

    Declaration
    public override void Files(SegmentCommitInfo info, ICollection<string> files)
    Parameters
    Type Name Description
    SegmentCommitInfo info
    ICollection<string> files
    Overrides
    LiveDocsFormat.Files(SegmentCommitInfo, ICollection<string>)

    NewLiveDocs(IBits)

    Creates a new mutablebits of the same bits set and size of existing.

    Declaration
    public override IMutableBits NewLiveDocs(IBits existing)
    Parameters
    Type Name Description
    IBits existing
    Returns
    Type Description
    IMutableBits
    Overrides
    LiveDocsFormat.NewLiveDocs(IBits)

    NewLiveDocs(int)

    Creates a new MutableBits, with all bits set, for the specified size.

    Declaration
    public override IMutableBits NewLiveDocs(int size)
    Parameters
    Type Name Description
    int size
    Returns
    Type Description
    IMutableBits
    Overrides
    LiveDocsFormat.NewLiveDocs(int)

    ReadLiveDocs(Directory, SegmentCommitInfo, IOContext)

    Read live docs bits.

    Declaration
    public override IBits ReadLiveDocs(Directory dir, SegmentCommitInfo info, IOContext context)
    Parameters
    Type Name Description
    Directory dir
    SegmentCommitInfo info
    IOContext context
    Returns
    Type Description
    IBits
    Overrides
    LiveDocsFormat.ReadLiveDocs(Directory, SegmentCommitInfo, IOContext)

    WriteLiveDocs(IMutableBits, Directory, SegmentCommitInfo, int, IOContext)

    Persist live docs bits. Use NextDelGen to determine the generation of the deletes file you should write to.

    Declaration
    public override void WriteLiveDocs(IMutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context)
    Parameters
    Type Name Description
    IMutableBits bits
    Directory dir
    SegmentCommitInfo info
    int newDelCount
    IOContext context
    Overrides
    LiveDocsFormat.WriteLiveDocs(IMutableBits, Directory, SegmentCommitInfo, int, IOContext)
    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.