public class Request extends Object implements SearchRequest
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
contextObjects
Context object Map that can hold object values.
|
protected Map<String,String> |
Control
Controls are querying stage flags and variables.
|
protected boolean |
EmptyQuery
does the query have any terms.
|
protected Index |
index
index will not be passed across RMI
|
protected MatchingQueryTerms |
matchingTerms
This is an aggregated form of the query terms, suitable for matching, which requires
term frequencies for each term.
|
protected int |
numOfDocsAfterFiltering
The number of documents returned after performing post filtering
|
protected String |
originalQuery
The query text, before applying any pre-processsing
|
protected Query |
q
This contains the parsed syntax tree of the query, as generated by the Antlr parser
|
protected String |
QueryID
QueryID - used by TREC querying and output format for supporting relevance assessments
|
protected ResultSet |
resultSet
This is the resultset of the query.
|
Constructor and Description |
---|
Request() |
Modifier and Type | Method and Description |
---|---|
void |
addMatchingModel(String MatchingModelName,
String WeightingModelName)
Set the matching model and weighting model that the Manager should use for this query
|
Object |
getContextObject(String key)
Returns the value of a context object.
|
String |
getControl(String Name)
Returns the value of the control.
|
Map<String,String> |
getControlHashtable()
Get the entire hashtable used for storing controls for this query
|
Index |
getIndex()
Returns the index to be used for this query
|
String |
getMatchingModel()
returns the name of the matching model that should be used for retrieval
|
MatchingQueryTerms |
getMatchingQueryTerms()
Return the MatchingQueryTerms object to use for matching
|
int |
getNumberOfDocumentsAfterFiltering()
returns the number of documents in the result set
after applying post filters.
|
String |
getOriginalQuery()
gets the string of the original query,
before applying any pre-processing.
|
Query |
getQuery()
Get the Query syntax tree
|
String |
getQueryID()
Returns the query id as set by setQueryID(String).
|
ResultSet |
getResultSet()
Returns the resultset generated by the query.
|
long |
getStartedProcessingTime()
returns the time when the processing of the
request started.
|
String |
getWeightingModel()
returns the name of the weighting model that should be used for retrieval
|
boolean |
isEmpty()
Set if the query input had no terms.
|
void |
setContextObject(String key,
Object value)
Set a value of a context object.
|
void |
setControl(String Name,
String Value)
Set a control named to have value Value.
|
void |
setControls(Map<String,String> controls)
Use this hashtable to store controls and their values in
|
void |
setEmpty(boolean in)
force this query to be seen as containing (no) terms.
|
void |
setIndex(Index _index)
Set the index to be used for this query
|
void |
setMatchingQueryTerms(MatchingQueryTerms mqts)
Used by runPreProcessing after the query tree has been
aggregated into a list of terms, each containing frequencies.
|
void |
setNumberOfDocumentsAfterFiltering(int n)
sets the number of documents in the result set,
after applying post filters.
|
void |
setOriginalQuery(String _q)
sets the string of the original query,
before applying any pre-processing
|
void |
setQuery(Query _q)
Set the query to be a parsed Query syntax tree, as generated by the Terrier query parser
|
void |
setQueryID(String qid)
Set a unique identifier for this query request.
|
void |
setResultSet(ResultSet results)
Set the result set returned by this object to be this results.
|
void |
setStartedProcessingTime(long _startedProcessingTime)
sets the time when the processing of the request started
|
protected boolean EmptyQuery
protected String QueryID
protected Map<String,String> Control
protected Map<String,Object> contextObjects
protected Query q
protected String originalQuery
protected int numOfDocsAfterFiltering
protected ResultSet resultSet
protected MatchingQueryTerms matchingTerms
protected transient Index index
public void addMatchingModel(String MatchingModelName, String WeightingModelName)
addMatchingModel
in interface SearchRequest
MatchingModelName
- the String class name that should be usedWeightingModelName
- the String class name that should be usedpublic void setQuery(Query _q)
setQuery
in interface SearchRequest
_q
- The Query object syntax treepublic void setQueryID(String qid)
setQueryID
in interface SearchRequest
qid
- the unique string identifierpublic void setIndex(Index _index)
public Index getIndex()
public void setControl(String Name, String Value)
setControl
in interface SearchRequest
Name
- the name of the control to set the value of.Value
- the value that the control should take.public String getControl(String Name)
getControl
in interface SearchRequest
public ResultSet getResultSet()
getResultSet
in interface SearchRequest
public String getQueryID()
getQueryID
in interface SearchRequest
public Query getQuery()
getQuery
in interface SearchRequest
public boolean isEmpty()
isEmpty
in interface SearchRequest
public String getWeightingModel()
public String getMatchingModel()
public void setResultSet(ResultSet results)
public Map<String,String> getControlHashtable()
public void setEmpty(boolean in)
in
- set to true for query to be seen empty.public void setMatchingQueryTerms(MatchingQueryTerms mqts)
mqts
- The matchingqueryterms to use for matching.public MatchingQueryTerms getMatchingQueryTerms()
public void setControls(Map<String,String> controls)
public void setOriginalQuery(String _q)
setOriginalQuery
in interface SearchRequest
public String getOriginalQuery()
getOriginalQuery
in interface SearchRequest
public void setNumberOfDocumentsAfterFiltering(int n)
setNumberOfDocumentsAfterFiltering
in interface SearchRequest
public int getNumberOfDocumentsAfterFiltering()
getNumberOfDocumentsAfterFiltering
in interface SearchRequest
public long getStartedProcessingTime()
getStartedProcessingTime
in interface SearchRequest
public void setStartedProcessingTime(long _startedProcessingTime)
setStartedProcessingTime
in interface SearchRequest
_startedProcessingTime
- the time obtained from a call
to System.currentTimeMillis()public void setContextObject(String key, Object value)
setContextObject
in interface SearchRequest
key
- the key of the context objectvalue
- the value of the context objectpublic Object getContextObject(String key)
getContextObject
in interface SearchRequest
key
- the key of the context object to getTerrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow