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(TermCodes termCodes)
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, insert, insert, termSet
protected 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 DocumentPostingList
public void clear()
DocumentPostingList
clear
in class DocumentPostingList
public int[][] getPostings(TermCodes termCodes)
DocumentPostingList
getPostings
in class DocumentPostingList
protected IterablePosting makePostingIterator(String[] _terms, int[] termIds)
makePostingIterator
in class DocumentPostingList
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class DocumentPostingList
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
write
in class DocumentPostingList
IOException
Terrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow