Package org.terrier.matching.daat
Class FatCandidateResultSet
- java.lang.Object
-
- org.terrier.matching.daat.CandidateResultSet
-
- org.terrier.matching.daat.FatCandidateResultSet
-
- All Implemented Interfaces:
java.io.Serializable
,org.apache.hadoop.io.Writable
,FatResultSet
,ResultSet
public class FatCandidateResultSet extends CandidateResultSet implements org.apache.hadoop.io.Writable, FatResultSet
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected WritablePosting[][]
postings
-
Fields inherited from class org.terrier.matching.daat.CandidateResultSet
docids, exactResultSize, lock, occurrences, resultSize, scores, statusCode
-
-
Constructor Summary
Constructors Constructor Description FatCandidateResultSet()
FatCandidateResultSet(java.util.Collection<CandidateResult> q, CollectionStatistics cs, java.lang.String[] queryTerms, EntryStatistics[] entryStats, double[] keyFrequency, java.util.Set<java.lang.String>[] tags)
FatCandidateResultSet(java.util.List<CandidateResult> q, CollectionStatistics cs, java.lang.String[] queryTerms, EntryStatistics[] entryStats, double[] keyFrequency)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CollectionStatistics
getCollectionStatistics()
Get the collection statistics that should be applied when (re)scoring any documents in this queryEntryStatistics[]
getEntryStatistics()
Return the EntryStatistics of each of the query terms in the querydouble[]
getKeyFrequencies()
Return the frequencies of each of the query terms in the queryWritablePosting[][]
getPostings()
Returns a 2D array of posting objects for the document and terms in this result set.java.lang.String[]
getQueryTerms()
Get the query terms in this query.FatResultSet
getResultSet(int start, int length)
Crops the existing result file and extracts a subset from the given starting point, with the given length.java.util.Set<java.lang.String>[]
getTags()
Return the tags of each of the query terms in the queryvoid
readFields(java.io.DataInput in)
void
setCollectionStatistics(CollectionStatistics cs)
void
setDocids(int[] ds)
void
setEntryStatistics(EntryStatistics[] es)
void
setKeyFrequencies(double[] ks)
void
setOccurrences(short[] os)
void
setPostings(WritablePosting[][] wp)
void
setQueryTerms(java.lang.String[] qs)
void
setScores(double[] ss)
void
setTags(java.util.Set<java.lang.String>[] tags)
void
sort(int topDocs)
Sorts the top topDocs document in this resultset be first.void
write(java.io.DataOutput out)
-
Methods inherited from class org.terrier.matching.daat.CandidateResultSet
addMetaItem, addMetaItems, allMetaItems, getDocids, getExactResultSize, getLock, getMetaItem, getMetaItems, getMetaKeys, getOccurrences, getResultSet, getResultSize, getScores, getStatusCode, hasMetaItems, initialise, initialise, setExactResultSize, setResultSize, setStatusCode, sort
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.terrier.matching.ResultSet
addMetaItem, addMetaItems, allMetaItems, getDocids, getExactResultSize, getLock, getMetaItem, getMetaItems, getMetaKeys, getOccurrences, getResultSet, getResultSize, getScores, getStatusCode, hasMetaItems, initialise, initialise, setExactResultSize, setResultSize, setStatusCode, sort
-
-
-
-
Field Detail
-
postings
protected WritablePosting[][] postings
-
-
Constructor Detail
-
FatCandidateResultSet
public FatCandidateResultSet()
-
FatCandidateResultSet
public FatCandidateResultSet(java.util.Collection<CandidateResult> q, CollectionStatistics cs, java.lang.String[] queryTerms, EntryStatistics[] entryStats, double[] keyFrequency, java.util.Set<java.lang.String>[] tags)
-
FatCandidateResultSet
@Deprecated public FatCandidateResultSet(java.util.List<CandidateResult> q, CollectionStatistics cs, java.lang.String[] queryTerms, EntryStatistics[] entryStats, double[] keyFrequency)
Deprecated.
-
-
Method Detail
-
getPostings
public WritablePosting[][] getPostings()
Description copied from interface:FatResultSet
Returns a 2D array of posting objects for the document and terms in this result set. The array is indexed by document then by term. The first dimension retains the same order as the Docids array of the result set. The second dimension has the same ordering as the QueryTerms/EntryStatistics arrays.- Specified by:
getPostings
in interfaceFatResultSet
- Returns:
- 2D array of postings.
-
getKeyFrequencies
public double[] getKeyFrequencies()
Description copied from interface:FatResultSet
Return the frequencies of each of the query terms in the query- Specified by:
getKeyFrequencies
in interfaceFatResultSet
-
getEntryStatistics
public EntryStatistics[] getEntryStatistics()
Description copied from interface:FatResultSet
Return the EntryStatistics of each of the query terms in the query- Specified by:
getEntryStatistics
in interfaceFatResultSet
-
getCollectionStatistics
public CollectionStatistics getCollectionStatistics()
Description copied from interface:FatResultSet
Get the collection statistics that should be applied when (re)scoring any documents in this query- Specified by:
getCollectionStatistics
in interfaceFatResultSet
-
getQueryTerms
public java.lang.String[] getQueryTerms()
Description copied from interface:FatResultSet
Get the query terms in this query. This might be encoded in PostingListManager form- Specified by:
getQueryTerms
in interfaceFatResultSet
-
readFields
public void readFields(java.io.DataInput in) throws java.io.IOException
- Specified by:
readFields
in interfaceorg.apache.hadoop.io.Writable
- Throws:
java.io.IOException
-
write
public void write(java.io.DataOutput out) throws java.io.IOException
- Specified by:
write
in interfaceorg.apache.hadoop.io.Writable
- Throws:
java.io.IOException
-
getResultSet
public FatResultSet getResultSet(int start, int length)
Description copied from class:CandidateResultSet
Crops the existing result file and extracts a subset from the given starting point, with the given length.- Specified by:
getResultSet
in interfaceResultSet
- Overrides:
getResultSet
in classCandidateResultSet
- Parameters:
start
- the beginning of the subset.length
- the length of the subset.- Returns:
- a subset of the current result set.
-
sort
public void sort(int topDocs)
Description copied from interface:ResultSet
Sorts the top topDocs document in this resultset be first. The order of the remaining documents is undefined.- Specified by:
sort
in interfaceResultSet
- Overrides:
sort
in classCandidateResultSet
- Parameters:
topDocs
- number of documents to top-rank
-
setPostings
public void setPostings(WritablePosting[][] wp)
- Specified by:
setPostings
in interfaceFatResultSet
-
setKeyFrequencies
public void setKeyFrequencies(double[] ks)
- Specified by:
setKeyFrequencies
in interfaceFatResultSet
-
setEntryStatistics
public void setEntryStatistics(EntryStatistics[] es)
- Specified by:
setEntryStatistics
in interfaceFatResultSet
-
setCollectionStatistics
public void setCollectionStatistics(CollectionStatistics cs)
- Specified by:
setCollectionStatistics
in interfaceFatResultSet
-
setQueryTerms
public void setQueryTerms(java.lang.String[] qs)
- Specified by:
setQueryTerms
in interfaceFatResultSet
-
setDocids
public void setDocids(int[] ds)
- Specified by:
setDocids
in interfaceFatResultSet
-
setOccurrences
public void setOccurrences(short[] os)
- Specified by:
setOccurrences
in interfaceFatResultSet
-
setScores
public void setScores(double[] ss)
- Specified by:
setScores
in interfaceFatResultSet
-
getTags
public java.util.Set<java.lang.String>[] getTags()
Description copied from interface:FatResultSet
Return the tags of each of the query terms in the query- Specified by:
getTags
in interfaceFatResultSet
-
setTags
public void setTags(java.util.Set<java.lang.String>[] tags)
- Specified by:
setTags
in interfaceFatResultSet
-
-