org.terrier.structures.indexing.singlepass
Class FieldPosting

java.lang.Object
  extended by org.terrier.structures.indexing.singlepass.Posting
      extended by org.terrier.structures.indexing.singlepass.FieldPosting

public class FieldPosting
extends Posting

Class holding the information for a posting list read from a previously written run at disk. Used in the merging phase of the Single pass inversion method. This class knows how to append itself to a BitOutputStream and it represents a posting with field information (tf, df, [docid, idf, field_f, field_f, field_f])

Author:
Roi Blanco and Craig Macdonald

Field Summary
 
Fields inherited from class org.terrier.structures.indexing.singlepass.Posting
docIds, lastInt, Nt, TF
 
Constructor Summary
FieldPosting()
           
 
Method Summary
 int insert(int doc, int freq, int[] fieldFrequencies)
          Inserts a new document in the posting list.
 int writeFirstDoc(int doc, int frequency, int[] fieldFrequencies)
          Writes the first document in the posting list.
 
Methods inherited from class org.terrier.structures.indexing.singlepass.Posting
getDocF, getDocs, getSize, getTF, insert, setDocF, setDocs, setTF, writeFirstDoc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldPosting

public FieldPosting()
Method Detail

writeFirstDoc

public int writeFirstDoc(int doc,
                         int frequency,
                         int[] fieldFrequencies)
                  throws java.io.IOException
Writes the first document in the posting list.

Parameters:
doc - the document identifier.
frequency - the frequency of the term in the document.
fieldFrequencies - tf in each field for the term in the document.
Throws:
java.io.IOException - if an I/O error ocurrs.

insert

public int insert(int doc,
                  int freq,
                  int[] fieldFrequencies)
           throws java.io.IOException
Inserts a new document in the posting list. Document insertions must be done in order.

Parameters:
doc - the document identifier.
freq - the frequency of the term in the document.
fieldFrequencies - the frequency of the term in the document.
Returns:
the number of bytes consumed in the buffer
Throws:
java.io.IOException - if and I/O error occurs.


Terrier 3.5. Copyright © 2004-2011 University of Glasgow