Interface VariableQuantumIndexWriter

  • All Known Implementing Classes:
    BitStreamHPIndexWriter, SkipBitStreamIndexWriter

    public interface VariableQuantumIndexWriter
    An index writer supporting variable quanta.

    This interface provides an additional newInvertedList(long, double, long, long) method that accepts additional information. That information is used to compute the correct quantum size for a specific list. This approach makes it possible to specify a target fraction of the index that will be used to store skipping information.

    • Method Summary

      Modifier and Type Method Description
      long newInvertedList​(long predictedFrequency, double skipFraction, long predictedSize, long predictedPositionsSize)
      Starts a new inverted list.
    • Method Detail

      • newInvertedList

        long newInvertedList​(long predictedFrequency,
                             double skipFraction,
                             long predictedSize,
                             long predictedPositionsSize)
                      throws IOException
        Starts a new inverted list. The previous inverted list, if any, is actually written to the underlying bit stream.

        This method provides additional information that will be used to compute the correct quantum for the skip structure of the inverted list.

        Parameters:
        predictedFrequency - the predicted frequency of the inverted list; this might just be an approximation.
        skipFraction - the fraction of the inverted list that will be dedicated to skipping structures.
        predictedSize - the predicted size of the part of the inverted list that stores terms and counts.
        predictedPositionsSize - the predicted size of the part of the inverted list that stores positions.
        Returns:
        the position (in bits) of the underlying bit stream where the new inverted list starts.
        Throws:
        IllegalStateException - if too few records were written for the previous inverted list.
        IOException
        See Also:
        IndexWriter.newInvertedList()