Class FieldOnlyIterablePosting

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, IterablePosting, Posting

    public class FieldOnlyIterablePosting
    extends IterablePostingImpl
    This class takes an IterablePosting list that has fields, and makes it appear as a single basic posting list.
    Since:
    4.2
    Author:
    Craig Macdonald
    • Constructor Detail

      • FieldOnlyIterablePosting

        public FieldOnlyIterablePosting​(IterablePosting _ip,
                                        int _fieldId)
    • Method Detail

      • next

        public int next()
                 throws java.io.IOException
        Description copied from interface: IterablePosting
        Move this iterator to the next posting.
        Returns:
        id of next posting, or EOL if end of posting list.
        Throws:
        java.io.IOException
      • getId

        public int getId()
        Description copied from interface: Posting
        Return the id of the current posting. For the inverted index, this is the current docid; for the direct index it corresponds to the current term id.
        Returns:
        id of the posting.
      • getFrequency

        public int getFrequency()
        Description copied from interface: Posting
        Return the frequency of the term in the current document, in tokens.
        Returns:
        frequency of the term in the current document, in tokens.
      • getDocumentLength

        public int getDocumentLength()
        Description copied from interface: Posting
        Return the length of the document of the current posting in tokens. Usually uses the DocumentIndex, may do otherwise if document length statistics are in posting list.
        Returns:
        length of the document of the current posting in tokens.
      • asWritablePosting

        public WritablePosting asWritablePosting()
        Description copied from interface: Posting
        Copy this posting to one free of an iterator. Kind of like a clone.
        Returns:
        an identical posting, but which can be manipulated free of this iterator
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException