public class QueryResultSet extends CollectionResultSet
| Modifier and Type | Field and Description |
|---|---|
protected String[][] |
metadata
The structure holding the metadata.
|
protected gnu.trove.TObjectIntHashMap<String> |
metaMap
The structure that holds the metadata about the results.
|
arraysInitialised, docids, exactResultSize, lock, occurrences, resultSize, scores, statusCode| Constructor and Description |
|---|
QueryResultSet(int numberOfDocuments)
A default constructor for the result set with a given
number of documents.
|
QueryResultSet(int[] docids,
double[] ds,
short[] occurrences) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMetaItem(String name,
int index,
String value)
Adds a metadata value for a given document
|
void |
addMetaItems(String name,
String[] values)
Adds the metadata values for all the documents in the result set.
|
protected int |
addMetaType(String name)
Get the metadata index for the given name
|
String[][] |
allMetaItems()
returns all metadata, indexed first by metadata type, then by rank.
|
String |
getMetaItem(String name,
int index)
Gets a metadata value for a given document.
|
String[] |
getMetaItems(String name)
Gets the metadata information for all documents.
|
String[] |
getMetaKeys()
Returns the names of the meta keys which this resultset has
|
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 startPosition,
int length)
Crops the existing result file and extracts a subset
from the given starting point to the ending point.
|
boolean |
hasMetaItems(String name)
does the metaindex have a particular type of metadata?
|
void |
initialise()
Initialises the arrays prior of retrieval.
|
protected QueryResultSet |
makeNewResultSet(int length) |
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.
|
getDocids, getExactResultSize, getLock, getOccurrences, getResultSize, getScores, getStatusCode, initialise, setExactResultSize, setResultSize, setStatusCodeprotected gnu.trove.TObjectIntHashMap<String> metaMap
protected String[][] metadata
public QueryResultSet(int numberOfDocuments)
numberOfDocuments - the number of documents contained in the result set.public QueryResultSet(int[] docids,
double[] ds,
short[] occurrences)
public void initialise()
initialise in interface ResultSetinitialise in class CollectionResultSetpublic void addMetaItem(String name, int index, String value)
addMetaItem in interface ResultSetaddMetaItem in class CollectionResultSetname - the name of the metadata type. For example, it can be url for adding the URLs of documents.index - the position in the resultset array of the given documentvalue - the metadata value.public void addMetaItems(String name, String[] values)
addMetaItems in interface ResultSetaddMetaItems in class CollectionResultSetname - 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 index)
getMetaItem in interface ResultSetgetMetaItem in class CollectionResultSetname - the name of the metadata type.index - the postition in the arraypublic String[] getMetaItems(String name)
getMetaItems in interface ResultSetgetMetaItems in class CollectionResultSetname - the name of the metadata type.public String[][] allMetaItems()
allMetaItems in interface ResultSetallMetaItems in class CollectionResultSetpublic boolean hasMetaItems(String name)
hasMetaItems in interface ResultSethasMetaItems in class CollectionResultSetname - of the desired metaitem setpublic String[] getMetaKeys()
getMetaKeys in interface ResultSetgetMetaKeys in class CollectionResultSetprotected int addMetaType(String name)
name - The name of the metadata type to add onprotected QueryResultSet makeNewResultSet(int length)
public ResultSet getResultSet(int startPosition, int length)
getResultSet in interface ResultSetgetResultSet in class CollectionResultSetstartPosition - the beginning of the subset.length - the number of entries to get.public ResultSet getResultSet(int[] positions)
getResultSet in interface ResultSetgetResultSet in class CollectionResultSetpositions - int[] the list of elements in the current
list that should be kept.public void sort()
ResultSetsort in interface ResultSetsort in class CollectionResultSetpublic void sort(int topDocs)
ResultSetsort in interface ResultSetsort in class CollectionResultSettopDocs - number of documents to top-rankTerrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow