com.sun.labs.minion.indexer.entry
Class FieldedDocKeyEntry
java.lang.Object
com.sun.labs.minion.indexer.entry.BaseEntry
com.sun.labs.minion.indexer.entry.SinglePostingsEntry
com.sun.labs.minion.indexer.entry.DocKeyEntry
com.sun.labs.minion.indexer.entry.FieldedDocKeyEntry
- All Implemented Interfaces:
- Entry, IndexEntry, MergeableEntry, QueryEntry, java.lang.Comparable
public class FieldedDocKeyEntry
- extends DocKeyEntry
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
compareTo |
FieldedDocKeyEntry
public FieldedDocKeyEntry()
- Creates a FieldedDocKeyEntry
FieldedDocKeyEntry
public FieldedDocKeyEntry(java.lang.Object name)
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 vectorwc
- 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)