Class AbstractBitStreamIndexWriter

  • All Implemented Interfaces:
    Direct Known Subclasses:
    BitStreamHPIndexWriter, BitStreamIndexWriter

    public abstract class AbstractBitStreamIndexWriter
    extends Object
    implements IndexWriter
    An abstract bitstream-based index writer, providing common variables and a basic printStats(PrintStream) implementation.

    Compression flags

    Implementing subclasses need to know the compression method that they should use to write frequencies, pointers, payloads, counts and positions (and whether to write any of them). This information is passed to the constructor using a suitable flag map (see CompressionFlags).

    Sebastiano Vigna
    • Field Detail

      • numberOfDocuments

        protected final long numberOfDocuments
        The number of documents of the collection to be indexed.
      • hasPayloads

        protected final boolean hasPayloads
        Whether this index contains payloads.
      • hasCounts

        protected final boolean hasCounts
        Whether this index contains counts.
      • hasPositions

        protected final boolean hasPositions
        Whether this index contains positions.
      • numberOfPostings

        protected long numberOfPostings
        The number of indexed postings (pairs term/document).
      • numberOfOccurrences

        protected long numberOfOccurrences
        The number of indexed occurrences.
      • currentTerm

        protected long currentTerm
        The current term.
      • bitsForFrequencies

        public long bitsForFrequencies
        The number of bits written for frequencies.
      • bitsForPointers

        public long bitsForPointers
        The number of bits written for document pointers.
      • bitsForCounts

        public long bitsForCounts
        The number of bits written for counts.
      • bitsForPayloads

        public long bitsForPayloads
        The number of bits written for payloads.
      • bitsForPositions

        public long bitsForPositions
        The number of bits written for positions.
    • Method Detail

      • printStats

        public void printStats​(PrintStream stats)
        Description copied from interface: IndexWriter
        Writes to the given print stream statistical information about the index just built. This method must be called after IndexWriter.close().
        Specified by:
        printStats in interface IndexWriter
        stats - a print stream where statistical information will be written.