Terrier IR Platform
2.2.1

uk.ac.gla.terrier.matching
Interface ResultSet

All Known Implementing Classes:
CollectionResultSet, QueryResultSet

public interface ResultSet

The interface that defines the functionalities of a result set.

Version:
$Revision: 1.23 $
Author:
Vassilis Plachouras

Method Summary
 void addMetaItem(java.lang.String name, int docid, java.lang.String value)
          Adds a metadata value for a given document
 void addMetaItems(java.lang.String name, java.lang.String[] values)
          Adds the metadata values for all the documents in the result set.
 int[] getDocids()
          Returns the documents ids after retrieval
 int getExactResultSize()
          Returns the exact size of the result set.
 java.util.concurrent.locks.Lock getLock()
          Returns the lock associated with the result set.
 java.lang.String getMetaItem(java.lang.String name, int docid)
          Gets a metadata value for a given document.
 java.lang.String[] getMetaItems(java.lang.String name)
          Gets the metadata information for all documents.
 short[] getOccurrences()
          Returns the occurrences array.
 ResultSet getResultSet(int[] list)
          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()
          Returns a status code for the result set
 void initialise()
          Initialises the arrays prior of retrieval.
 void initialise(double[] scs)
          Initialises the result set with the given scores.
 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)
          Sets the status code.
 

Method Detail

addMetaItem

void addMetaItem(java.lang.String name,
                 int docid,
                 java.lang.String value)
Adds a metadata value for a given document

Parameters:
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.

addMetaItems

void addMetaItems(java.lang.String name,
                  java.lang.String[] values)
Adds the metadata values for all the documents in the result set. The length of the metadata array values should be equal to the length of the docids array.

Parameters:
name - the name of the metadata type. For example, it can be url for adding the URLs of documents.
values - the metadata values.

getDocids

int[] getDocids()
Returns the documents ids after retrieval


getExactResultSize

int getExactResultSize()
Returns the exact size of the result set.

Returns:
int the exact size of the result set

getMetaItem

java.lang.String getMetaItem(java.lang.String name,
                             int docid)
Gets a metadata value for a given document. If the requested metadata information is not specified, then we return null.

Parameters:
name - the name of the metadata type.
docid - the document identifier of the document.
Returns:
a string with the metadata information, or null of the metadata is not available.

getMetaItems

java.lang.String[] getMetaItems(java.lang.String name)
Gets the metadata information for all documents. If the requested metadata information is not specified, then we return null.

Parameters:
name - the name of the metadata type.
Returns:
an array of strings with the metadata information, or null of the metadata is not available.

getOccurrences

short[] getOccurrences()
Returns the occurrences array.

Returns:
int[] the array the occurrences array.

getResultSize

int getResultSize()
Returns the effective size of the result set.

Returns:
int the effective size of the result set

getScores

double[] getScores()
Returns the documents scores after retrieval


initialise

void initialise()
Initialises the arrays prior of retrieval.


initialise

void initialise(double[] scs)
Initialises the result set with the given scores. If the length of the given array is different than the length of the internal arrays, then we re-allocate memory and create the arrays.

Parameters:
scs - double[] the scores to initiliase the result set with.

setExactResultSize

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.

Parameters:
newExactResultSize - int the effective size of the result set.

setResultSize

void setResultSize(int newResultSize)
Sets the effective size of the result set, that is the number of documents to be sorted after retrieval.

Parameters:
newResultSize - int the effective size of the result set.

getResultSet

ResultSet getResultSet(int start,
                       int length)
Crops the existing result file and extracts a subset from the given starting point, with the given length.

Parameters:
start - the beginning of the subset.
length - the length of the subset.
Returns:
a subset of the current result set.

getResultSet

ResultSet getResultSet(int[] list)
Extracts a subset of the resultset given by the list parameter, which contains a list of positions in the resultset that should be saved.

Parameters:
list - the list of elements in the current list that should be kept.
Returns:
a subset of the current result set specified by the list.

getLock

java.util.concurrent.locks.Lock getLock()
Returns the lock associated with the result set. The lock is used for modifying the result set concurrently by more than one threads.

Returns:
the lock.

getStatusCode

int getStatusCode()
Returns a status code for the result set

Returns:
a integer status code. 0 stands success. 1 stands for empty result set. 2 stands for wrong setting of start/end parameters. 3 stands for query timeout. The values assigned to the status codes are increasing accordingly to the severity of the status.

setStatusCode

void setStatusCode(int _statusCode)
Sets the status code.


Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow