Class MemoryDirectIndex

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, PostingIndex<MemoryPointer>
    Direct Known Subclasses:
    MemoryFieldsDirectIndex

    public class MemoryDirectIndex
    extends java.lang.Object
    implements PostingIndex<MemoryPointer>
    This is a DirectIndex structure that is held fully in memory, it is based upon the MemoryInverted class. It does not currently support blocks or fields. In v5.2 it was updated to change the way that termids and frequencies were stored, such that we can generate an ordered list of termids. This means that it will take more memory (+50%) and
    Since:
    4.0
    Author:
    Richard McCreadie
    • Constructor Detail

      • MemoryDirectIndex

        public MemoryDirectIndex​(DocumentIndex doi)
        Constructor.
    • Method Detail

      • add

        public void add​(int ptr,
                        int termid,
                        int freq)
        Add posting to direct file.
      • getPostings

        public IterablePosting getPostings​(int pointer)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException