|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.labs.minion.indexer.entry.BaseEntry
com.sun.labs.minion.indexer.entry.SinglePostingsEntry
com.sun.labs.minion.indexer.entry.DocKeyEntry
public class DocKeyEntry
A class for holding entries in the document dictionary. Such entries have ID and frequency postings and they encode their IDs into the dictionary, since that information cannot be recovered any other way.
| Field Summary | |
|---|---|
protected int |
docLen
The length of the document, in words. |
protected static java.lang.String |
logTag
|
protected int |
origID
The original document ID before remapping. |
protected DocKeyEntry |
prevEntry
A previous entry, appended onto our entry, used to detect when we've got a duplicate key during a merge. |
| Fields inherited from class com.sun.labs.minion.indexer.entry.SinglePostingsEntry |
|---|
n, offset, p, size, tsize |
| Fields inherited from class com.sun.labs.minion.indexer.entry.BaseEntry |
|---|
dict, id, name, postIn |
| Constructor Summary | |
|---|---|
DocKeyEntry()
|
|
DocKeyEntry(java.lang.Object name)
|
|
| Method Summary | |
|---|---|
void |
append(QueryEntry qe,
int start,
int[] idMap)
Appends, with a check for a duplicate key, which is bad. |
void |
decodePostingsInfo(ReadableBuffer b,
int pos)
Decodes the postings information associated with this entry. |
void |
encodePostingsInfo(WriteableBuffer b)
Encodes any information associated with the postings onto the given buffer. |
int |
getDocumentLength()
Gets the document length in words. |
float |
getDocumentVectorLength()
Gets the length of the vector associated with this document. |
float |
getDocumentVectorLength(int fieldID)
|
float |
getDocumentVectorLength(java.lang.String field)
|
Entry |
getEntry()
Gets a new entry that contains a copy of the data in this entry. |
Entry |
getEntry(java.lang.Object name)
Gets a new entry with the given name. |
int |
getOrigID()
|
Postings |
getPostings()
Gets the appropriate postings type for the class. |
protected Postings |
getPostings(ReadableBuffer input)
Gets a set of postings useful at query time. |
long |
getTotalOccurrences()
Returns the total number of occurrences, which is the same as the document length. |
WeightedFeature[] |
getWeightedFeatures(WeightingFunction wf,
WeightingComponents wc)
Gets an array of weighted features associated with this document key. |
void |
merge(QueryEntry qe,
int[] map)
Merges the entries in the postings underlying the other document key with the entries in the postings for this key. |
boolean |
writePostings(PostingsOutput[] out,
int[] idMap)
Writes the postings associated with this entry to some or all of the given channels. |
| Methods inherited from class com.sun.labs.minion.indexer.entry.SinglePostingsEntry |
|---|
add, copyData, getMaxFDT, getN, getNumChannels, hasFieldInformation, hasPositionInformation, iterator, readPostings |
| Methods inherited from class com.sun.labs.minion.indexer.entry.BaseEntry |
|---|
compareTo, getID, getName, getPartition, setDictionary, setID, setName, setPostingsInput, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.sun.labs.minion.indexer.entry.IndexEntry |
|---|
add, setID, setName |
| Methods inherited from interface com.sun.labs.minion.indexer.entry.Entry |
|---|
getID, getMaxFDT, getN, getName, getNumChannels, getPartition, setDictionary |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
protected int docLen
protected DocKeyEntry prevEntry
protected int origID
protected static java.lang.String logTag
| Constructor Detail |
|---|
public DocKeyEntry()
public DocKeyEntry(java.lang.Object name)
| Method Detail |
|---|
public Entry getEntry(java.lang.Object name)
Entry
getEntry in interface Entryname - the name that we want to give the entry.
public Entry getEntry()
getEntry in interface EntrygetEntry in class SinglePostingsEntryjava.lang.ClassCastException - if the provided entry is not of type
SinglePostingsEntrypublic int getOrigID()
public void append(QueryEntry qe,
int start,
int[] idMap)
append in interface IndexEntryappend in class SinglePostingsEntryqe - The entry that we want to append onto this one.start - The new starting ID for the partition that the entry
was drawn from.idMap - A map from old IDs in the given postings to new IDs
with gaps removed for deleted data. If this is null,
then there are no deleted documents.
public void merge(QueryEntry qe,
int[] map)
merge in interface MergeableEntryqe - The entry that we want to append onto this one.map - A map from old IDs in the given postings to new IDs
with gaps removed for deleted data. If this is null,
then there are no deleted documents.
public WeightedFeature[] getWeightedFeatures(WeightingFunction wf,
WeightingComponents wc)
wf - a weighting function to use to get the weight for the entries
in the document vectorwc - a set of weighting components to use with the weighting
function.SearchEngineImpl.getDocumentVector(Document,String)public Postings getPostings()
getPostings in class SinglePostingsEntryprotected Postings getPostings(ReadableBuffer input)
getPostings in class SinglePostingsEntryinput - The buffer containing the postings read from the
postings file.
public boolean writePostings(PostingsOutput[] out,
int[] idMap)
throws java.io.IOException
writePostings in interface IndexEntrywritePostings in class SinglePostingsEntryout - The outputs to which we will write the postings.idMap - A map from the IDs currently used in the postings to
the IDs that should be used when the postings are written to disk.
This may be null, in which case no remapping will
occur.
java.io.IOException - if there is any error writing the
postings.public void encodePostingsInfo(WriteableBuffer b)
encodePostingsInfo in interface IndexEntryencodePostingsInfo in class SinglePostingsEntryb - The buffer onto which the postings information should be
encoded. The buffer will be positioned to the correct spot for the
encoding.
public void decodePostingsInfo(ReadableBuffer b,
int pos)
decodePostingsInfo in interface QueryEntrydecodePostingsInfo in class SinglePostingsEntryb - The buffer containing the encoded postings information.pos - The position in b where the postings
information can be found.public long getTotalOccurrences()
getTotalOccurrences in interface EntrygetTotalOccurrences in class SinglePostingsEntrypublic int getDocumentLength()
public float getDocumentVectorLength()
public float getDocumentVectorLength(java.lang.String field)
public float getDocumentVectorLength(int fieldID)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||