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 CollectionStatisticsgetCollectionStatistics()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.FatResultSetgetResultSet(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 queryvoidreadFields(java.io.DataInput in)voidsetCollectionStatistics(CollectionStatistics cs)voidsetDocids(int[] ds)voidsetEntryStatistics(EntryStatistics[] es)voidsetKeyFrequencies(double[] ks)voidsetOccurrences(short[] os)voidsetPostings(WritablePosting[][] wp)voidsetQueryTerms(java.lang.String[] qs)voidsetScores(double[] ss)voidsetTags(java.util.Set<java.lang.String>[] tags)voidsort(int topDocs)Sorts the top topDocs document in this resultset be first.voidwrite(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:FatResultSetReturns 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:
getPostingsin interfaceFatResultSet- Returns:
- 2D array of postings.
-
getKeyFrequencies
public double[] getKeyFrequencies()
Description copied from interface:FatResultSetReturn the frequencies of each of the query terms in the query- Specified by:
getKeyFrequenciesin interfaceFatResultSet
-
getEntryStatistics
public EntryStatistics[] getEntryStatistics()
Description copied from interface:FatResultSetReturn the EntryStatistics of each of the query terms in the query- Specified by:
getEntryStatisticsin interfaceFatResultSet
-
getCollectionStatistics
public CollectionStatistics getCollectionStatistics()
Description copied from interface:FatResultSetGet the collection statistics that should be applied when (re)scoring any documents in this query- Specified by:
getCollectionStatisticsin interfaceFatResultSet
-
getQueryTerms
public java.lang.String[] getQueryTerms()
Description copied from interface:FatResultSetGet the query terms in this query. This might be encoded in PostingListManager form- Specified by:
getQueryTermsin interfaceFatResultSet
-
readFields
public void readFields(java.io.DataInput in) throws java.io.IOException- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Throws:
java.io.IOException
-
write
public void write(java.io.DataOutput out) throws java.io.IOException- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Throws:
java.io.IOException
-
getResultSet
public FatResultSet getResultSet(int start, int length)
Description copied from class:CandidateResultSetCrops the existing result file and extracts a subset from the given starting point, with the given length.- Specified by:
getResultSetin interfaceResultSet- Overrides:
getResultSetin 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:ResultSetSorts the top topDocs document in this resultset be first. The order of the remaining documents is undefined.- Specified by:
sortin interfaceResultSet- Overrides:
sortin classCandidateResultSet- Parameters:
topDocs- number of documents to top-rank
-
setPostings
public void setPostings(WritablePosting[][] wp)
- Specified by:
setPostingsin interfaceFatResultSet
-
setKeyFrequencies
public void setKeyFrequencies(double[] ks)
- Specified by:
setKeyFrequenciesin interfaceFatResultSet
-
setEntryStatistics
public void setEntryStatistics(EntryStatistics[] es)
- Specified by:
setEntryStatisticsin interfaceFatResultSet
-
setCollectionStatistics
public void setCollectionStatistics(CollectionStatistics cs)
- Specified by:
setCollectionStatisticsin interfaceFatResultSet
-
setQueryTerms
public void setQueryTerms(java.lang.String[] qs)
- Specified by:
setQueryTermsin interfaceFatResultSet
-
setDocids
public void setDocids(int[] ds)
- Specified by:
setDocidsin interfaceFatResultSet
-
setOccurrences
public void setOccurrences(short[] os)
- Specified by:
setOccurrencesin interfaceFatResultSet
-
setScores
public void setScores(double[] ss)
- Specified by:
setScoresin interfaceFatResultSet
-
getTags
public java.util.Set<java.lang.String>[] getTags()
Description copied from interface:FatResultSetReturn the tags of each of the query terms in the query- Specified by:
getTagsin interfaceFatResultSet
-
setTags
public void setTags(java.util.Set<java.lang.String>[] tags)
- Specified by:
setTagsin interfaceFatResultSet
-
-