com.sun.labs.minion.indexer.entry
Class FieldedDocKeyEntry

java.lang.Object
  extended by com.sun.labs.minion.indexer.entry.BaseEntry
      extended by com.sun.labs.minion.indexer.entry.SinglePostingsEntry
          extended by com.sun.labs.minion.indexer.entry.DocKeyEntry
              extended by com.sun.labs.minion.indexer.entry.FieldedDocKeyEntry
All Implemented Interfaces:
Entry, IndexEntry, MergeableEntry, QueryEntry, java.lang.Comparable

public class FieldedDocKeyEntry
extends DocKeyEntry


Field Summary
 
Fields inherited from class com.sun.labs.minion.indexer.entry.DocKeyEntry
docLen, logTag, origID, prevEntry
 
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
FieldedDocKeyEntry()
          Creates a FieldedDocKeyEntry
FieldedDocKeyEntry(java.lang.Object name)
           
 
Method Summary
 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.
 Postings getPostings()
          Gets the appropriate postings type for the class.
protected  Postings getPostings(ReadableBuffer input)
          Gets a set of postings useful at query time.
 WeightedFeature[] getWeightedFeatures(int field, WeightingFunction wf, WeightingComponents wc)
          Gets an array of weighted features associated with a field in 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.DocKeyEntry
append, decodePostingsInfo, encodePostingsInfo, getDocumentLength, getDocumentVectorLength, getDocumentVectorLength, getDocumentVectorLength, getOrigID, getTotalOccurrences, getWeightedFeatures
 
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
 

Constructor Detail

FieldedDocKeyEntry

public FieldedDocKeyEntry()
Creates a FieldedDocKeyEntry


FieldedDocKeyEntry

public FieldedDocKeyEntry(java.lang.Object name)
Method Detail

getEntry

public Entry getEntry(java.lang.Object name)
Description copied from interface: Entry
Gets a new entry with the given name.

Specified by:
getEntry in interface Entry
Overrides:
getEntry in class DocKeyEntry
Parameters:
name - the name that we want to give the entry.
Returns:
a new entry.

getEntry

public Entry getEntry()
Gets a new entry that contains a copy of the data in this entry.

Specified by:
getEntry in interface Entry
Overrides:
getEntry in class DocKeyEntry
Returns:
a new entry containing a copy of hte data in this entry.
Throws:
java.lang.ClassCastException - if the provided entry is not of type SinglePostingsEntry

merge

public 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. During indexing, we may want to merge the contents of two document key entries, for example, when dumping feature clusters during classification. so we need to be able to get the list of entries in the underlying postings.

Specified by:
merge in interface MergeableEntry
Overrides:
merge in class DocKeyEntry
Parameters:
qe - 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.

getPostings

public Postings getPostings()
Gets the appropriate postings type for the class. These postings should be useable for indexing.

Overrides:
getPostings in class DocKeyEntry
Returns:
A set of ID and frequency postings.

getPostings

protected Postings getPostings(ReadableBuffer input)
Gets a set of postings useful at query time.

Overrides:
getPostings in class DocKeyEntry
Parameters:
input - The buffer containing the postings read from the postings file.
Returns:
A set of ID and frequency postings.

writePostings

public boolean writePostings(PostingsOutput[] out,
                             int[] idMap)
                      throws java.io.IOException
Writes the postings associated with this entry to some or all of the given channels.

Specified by:
writePostings in interface IndexEntry
Overrides:
writePostings in class DocKeyEntry
Parameters:
out - 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.
Returns:
true if postings were written, false otherwise
Throws:
java.io.IOException - if there is any error writing the postings.

getWeightedFeatures

public WeightedFeature[] getWeightedFeatures(int field,
                                             WeightingFunction wf,
                                             WeightingComponents wc)
Gets an array of weighted features associated with a field in this document key. This can be used to generate a document vector for a document that was indexed but not dumped to disk.

Parameters:
field - the ID of the field for which we want postings.
wf - a weighting function to use to get the weight for the entries in the document vector
wc - a set of weighting components to use with the weighting function.
Returns:
an array of weighted features in the field
See Also:
SearchEngineImpl.getDocumentVector(Document,String)