Class Lucene50LiveDocsFormat


  • public final class Lucene50LiveDocsFormat
    extends LiveDocsFormat
    Lucene 5.0 live docs format

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

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

    Deletions (.liv) --> IndexHeader,Generation,Bits

    • Constructor Detail

      • Lucene50LiveDocsFormat

        public Lucene50LiveDocsFormat()
        Sole constructor.
    • Method Detail

      • readFixedBitSet

        private FixedBitSet readFixedBitSet​(IndexInput input,
                                            int length)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • writeLiveDocs

        public void writeLiveDocs​(Bits bits,
                                  Directory dir,
                                  SegmentCommitInfo info,
                                  int newDelCount,
                                  IOContext context)
                           throws java.io.IOException
        Note: although this format is only used on older versions, we need to keep the write logic in addition to the read logic. When we delete documents that live in an older segment, we write to the live docs for that segment.
        Specified by:
        writeLiveDocs in class LiveDocsFormat
        Throws:
        java.io.IOException
      • writeBits

        private int writeBits​(IndexOutput output,
                              Bits bits)
                       throws java.io.IOException
        Throws:
        java.io.IOException