Class FieldDocumentPostingList

    • Field Detail

      • fieldCount

        protected final int fieldCount
        number of fields
      • fieldLengths

        protected final int[] fieldLengths
        length of each field
      • field_occurrences

        protected final gnu.trove.TObjectIntHashMap<java.lang.String>[] field_occurrences
        occurrences of terms in fields
    • Constructor Detail

      • FieldDocumentPostingList

        public FieldDocumentPostingList​(int NUM_FIELDS)
        constructor
        Parameters:
        NUM_FIELDS -
    • Method Detail

      • insert

        public void insert​(int tf,
                           java.lang.String term,
                           int fieldNum)
        Insert a term into the posting list of this document, in the given field, with the given frequency
        Parameters:
        tf - frequency of the term in this document
        term - String form of term
        fieldNum - fieldNumber it occurs in
      • insert

        public void insert​(java.lang.String term,
                           int fieldNum)
        Insert a term into the posting list of this document, in the given field
        Parameters:
        term - the Term being inserted
        fieldNum - the id of the field that the term was found in
      • insert

        public void insert​(java.lang.String term,
                           int[] fieldNums)
        Insert a term into the posting list of this document, in the given field
        Parameters:
        term - the Term being inserted
        fieldNums - the ids of the fields that the term was found in, starting from 0
      • insert

        public void insert​(int tf,
                           java.lang.String term,
                           int[] fieldNums)
        Insert a term into the posting list of this document, in the given field
        Parameters:
        tf - the frequency of the term
        term - the Term being inserted
        fieldNums - the ids of the fields that the term was found in
      • getFieldFrequencies

        public int[] getFieldFrequencies​(java.lang.String term)
        Return the frequencies of the specified term in all of the fields
      • readFields

        public void readFields​(java.io.DataInput in)
                        throws java.io.IOException
        Specified by:
        readFields in interface org.apache.hadoop.io.Writable
        Overrides:
        readFields in class DocumentPostingList
        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
        Overrides:
        write in class DocumentPostingList
        Throws:
        java.io.IOException