Class FatQueryResultSet

    • Constructor Detail

      • FatQueryResultSet

        public FatQueryResultSet​(int numberOfDocuments,
                                 CollectionStatistics cs,
                                 java.lang.String[] qs,
                                 EntryStatistics[] es,
                                 double[] ks,
                                 java.util.Set<java.lang.String>[] ts)
    • Method Detail

      • getPostings

        public WritablePosting[][] getPostings()
        Returns a 2D array of posting objects for the document and terms in this result set. The array is indexed by document then by term. The first dimension retains the same order as the Docids array of the result set. The second dimension has the same ordering as the QueryTerms/EntryStatistics arrays.
        Specified by:
        getPostings in interface FatResultSet
        Returns:
        2D array of postings.
      • getKeyFrequencies

        public double[] getKeyFrequencies()
        Return the frequencies of each of the query terms in the query
        Specified by:
        getKeyFrequencies in interface FatResultSet
      • getQueryTerms

        public java.lang.String[] getQueryTerms()
        Get the query terms in this query. This might be encoded in PostingListManager form
        Specified by:
        getQueryTerms in interface FatResultSet
      • readFields

        public void readFields​(java.io.DataInput in)
                        throws java.io.IOException
        Specified by:
        readFields in interface org.apache.hadoop.io.Writable
        Throws:
        java.io.IOException
      • write

        public void write​(java.io.DataOutput out)
                   throws java.io.IOException
        Specified by:
        write in interface org.apache.hadoop.io.Writable
        Throws:
        java.io.IOException
      • getResultSet

        public FatResultSet getResultSet​(int start,
                                         int length)
        Crops the existing result file and extracts a subset from the given starting point to the ending point.
        Specified by:
        getResultSet in interface ResultSet
        Overrides:
        getResultSet in class QueryResultSet
        Parameters:
        start - the beginning of the subset.
        length - the number of entries to get.
        Returns:
        a subset of the current result set.
      • sort

        public void sort​(int topDocs)
        Sorts the top topDocs document in this resultset be first. The order of the remaining documents is undefined.
        Specified by:
        sort in interface ResultSet
        Overrides:
        sort in class QueryResultSet
        Parameters:
        topDocs - number of documents to top-rank
      • setQueryTerms

        public void setQueryTerms​(java.lang.String[] qs)
        Specified by:
        setQueryTerms in interface FatResultSet
      • getTags

        public java.util.Set<java.lang.String>[] getTags()
        Description copied from interface: FatResultSet
        Return the tags of each of the query terms in the query
        Specified by:
        getTags in interface FatResultSet
      • setTags

        public void setTags​(java.util.Set<java.lang.String>[] ks)
        Specified by:
        setTags in interface FatResultSet