public class AccumulatorResultSet extends Object implements ResultSet, Serializable
Modifier and Type | Field and Description |
---|---|
protected boolean |
arraysInitialised |
int[] |
docids
docid[]
|
protected int |
exactResultSize |
protected Lock |
lock |
protected boolean |
mapsInitialised |
short[] |
occurrences
occurrences
|
gnu.trove.TIntShortHashMap |
occurrencesMap
occurrence map
|
protected int |
resultSize |
double[] |
scores
scores[]
|
gnu.trove.TIntDoubleHashMap |
scoresMap
score map
|
protected int |
statusCode |
Constructor and Description |
---|
AccumulatorResultSet(int numberOfDocuments)
Constructs an instance of the AccumulatorResultSet
|
Modifier and Type | Method and Description |
---|---|
void |
addMetaItem(String name,
int docid,
String value)
Unsupported
|
void |
addMetaItems(String name,
String[] values)
Unsupported
|
AccumulatorResultSet |
getAccumulatorResultSet(int start,
int length) |
int[] |
getDocids()
Returns the documents ids after retrieval
|
int |
getExactResultSize()
Returns the exact size of the result set.
|
Lock |
getLock()
get lock
|
String |
getMetaItem(String name,
int docid)
Unsupported
|
String[] |
getMetaItems(String name)
Unsupported
|
String[] |
getMetaKeys()
Unsupported
|
short[] |
getOccurrences()
Returns the occurrences array.
|
ResultSet |
getResultSet(int[] positions)
Extracts a subset of the resultset given by the list parameter,
which contains a list of positions in the resultset that
should be saved.
|
ResultSet |
getResultSet(int start,
int length)
Crops the existing result file and extracts a subset
from the given starting point, with the given length.
|
int |
getResultSize()
Returns the effective size of the result set.
|
double[] |
getScores()
Returns the documents scores after retrieval
|
int |
getStatusCode()
get status code
|
boolean |
hasMetaItems(String name)
Unsupported
|
void |
initialise()
This method initialises the arrays to be sorted, after the matching phase has been completed
|
void |
initialise(double[] scs)
Unsupported
|
void |
setExactResultSize(int newExactResultSize)
Sets the exact size of the result set, that is
the number of documents that contain at least one query term.
|
void |
setResultSize(int newResultSize)
Sets the effective size of the result set, that
is the number of documents to be sorted after retrieval.
|
void |
setStatusCode(int _statusCode)
set status code
|
void |
sort()
Sorts all documents in this resultset by descending score
|
void |
sort(int topDocs)
Sorts the top topDocs document in this resultset be first.
|
public int[] docids
public double[] scores
public short[] occurrences
protected boolean arraysInitialised
public gnu.trove.TIntDoubleHashMap scoresMap
public gnu.trove.TIntShortHashMap occurrencesMap
protected boolean mapsInitialised
protected int resultSize
protected int exactResultSize
protected Lock lock
protected int statusCode
public AccumulatorResultSet(int numberOfDocuments)
numberOfDocuments
- maximum size of the result set.public Lock getLock()
public int getStatusCode()
getStatusCode
in interface ResultSet
public void setStatusCode(int _statusCode)
setStatusCode
in interface ResultSet
_statusCode
- - the code to return to the userpublic void initialise()
initialise
in interface ResultSet
public void initialise(double[] scs)
initialise
in interface ResultSet
scs
- double[] the scores to initiliase the result set with.public int[] getDocids()
public int getResultSize()
getResultSize
in interface ResultSet
public short[] getOccurrences()
getOccurrences
in interface ResultSet
public int getExactResultSize()
getExactResultSize
in interface ResultSet
public double[] getScores()
public void setResultSize(int newResultSize)
setResultSize
in interface ResultSet
newResultSize
- int the effective size of the result set.public void setExactResultSize(int newExactResultSize)
setExactResultSize
in interface ResultSet
newExactResultSize
- int the effective size of the result set.public void sort()
ResultSet
public void sort(int topDocs)
ResultSet
public void addMetaItem(String name, int docid, String value)
addMetaItem
in interface ResultSet
name
- the name of the metadata type. For example, it can be url for adding the URLs of documents.docid
- the document identifier of the document.value
- the metadata value.public void addMetaItems(String name, String[] values)
addMetaItems
in interface ResultSet
name
- the name of the metadata type. For example, it can be url for adding the URLs of documents.values
- the metadata values.public String getMetaItem(String name, int docid)
getMetaItem
in interface ResultSet
name
- the name of the metadata type.docid
- the document identifier of the document.public String[] getMetaItems(String name)
getMetaItems
in interface ResultSet
name
- the name of the metadata type.public boolean hasMetaItems(String name)
hasMetaItems
in interface ResultSet
name
- of the desired metaitem setpublic String[] getMetaKeys()
getMetaKeys
in interface ResultSet
public ResultSet getResultSet(int start, int length)
getResultSet
in interface ResultSet
start
- the beginning of the subset.length
- the length of the subset.public ResultSet getResultSet(int[] positions)
getResultSet
in interface ResultSet
positions
- the list of elements in the current list that should be kept.public AccumulatorResultSet getAccumulatorResultSet(int start, int length)
start
- the starting offsetlength
- the number of results to keepReturns a ResultSet starting at the
pre-determined position, of the specified size.
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow