public class FieldDocumentPostingList extends DocumentPostingList
DocumentPostingList.postingIterator| Modifier and Type | Field and Description |
|---|---|
protected gnu.trove.TObjectIntHashMap<String>[] |
field_occurrences
occurrences of terms in fields
|
protected int |
fieldCount
number of fields
|
protected int[] |
fieldLengths
length of each field
|
AVG_DOCUMENT_UNIQUE_TERMS, documentLength, occurrences| Constructor and Description |
|---|
FieldDocumentPostingList(int NUM_FIELDS)
constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all postings from this document
|
DocumentIndexEntry |
getDocumentStatistics()
Return a DocumentIndexEntry for this document
|
int[] |
getFieldFrequencies(String term)
Return the frequencies of the specified term in all of the fields
|
int[][] |
getPostings()
Returns the postings suitable to be written into the direct index.
|
void |
insert(int tf,
String term,
int fieldNum)
Insert a term into the posting list of this document, in the given field, with the given frequency
|
void |
insert(int tf,
String term,
int[] fieldNums)
Insert a term into the posting list of this document, in the given field
|
void |
insert(String term,
int fieldNum)
Insert a term into the posting list of this document, in the given field
|
void |
insert(String term,
int[] fieldNums)
Insert a term into the posting list of this document, in the given field
|
protected IterablePosting |
makePostingIterator(String[] _terms,
int[] termIds) |
void |
readFields(DataInput in) |
void |
write(DataOutput out) |
forEachTerm, getDocumentLength, getFrequency, getNumberOfPointers, getPostings2, getTermId, insert, insert, termSetprotected final int fieldCount
protected final int[] fieldLengths
protected final gnu.trove.TObjectIntHashMap<String>[] field_occurrences
public FieldDocumentPostingList(int NUM_FIELDS)
NUM_FIELDS - public void insert(int tf,
String term,
int fieldNum)
tf - frequency of the term in this documentterm - String form of termfieldNum - fieldNumber it occurs inpublic void insert(String term, int fieldNum)
term - the Term being insertedfieldNum - the id of the field that the term was found inpublic void insert(String term, int[] fieldNums)
term - the Term being insertedfieldNums - the ids of the fields that the term was found in, starting from 0public void insert(int tf,
String term,
int[] fieldNums)
tf - the frequency of the termterm - the Term being insertedfieldNums - the ids of the fields that the term was found inpublic int[] getFieldFrequencies(String term)
public DocumentIndexEntry getDocumentStatistics()
getDocumentStatistics in class DocumentPostingListpublic void clear()
DocumentPostingListclear in class DocumentPostingListpublic int[][] getPostings()
DocumentPostingListgetPostings in class DocumentPostingListprotected IterablePosting makePostingIterator(String[] _terms, int[] termIds)
makePostingIterator in class DocumentPostingListpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritablereadFields in class DocumentPostingListIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.Writablewrite in class DocumentPostingListIOExceptionTerrier 4.0. Copyright © 2004-2014 University of Glasgow