public interface SearchRequest extends Serializable
Index index = Index.createIndex(); Manager manager = new Manager(index); SearchRequest srq = manager.newSearchRequest("my query"); //run the query m.runPreProcessing(srq); manager.runMatching(srq); manager.runPostProcess(srq); manager.runPostFilters(srq);
NB:Controls (name, value String tuples) are used to control the retrieval process. You may want to set controls in your application code. However, default controls can be set using the querying.default.controls property in the terrier.properties file.
Context Objects (name, value object tuples) are used to pass arbitrary information to classes within Terrier.
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.
|
int |
getNumberOfDocumentsAfterFiltering()
gets the number of documents returned for a search request, after
applying post filtering
|
String |
getOriginalQuery()
gets the original query, before any preprocessing
|
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 the process start.
|
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 |
setNumberOfDocumentsAfterFiltering(int n)
Sets the number of documents returned for a search request, after
applying post filtering
|
void |
setOriginalQuery(String q)
sets the original query, before any preprocessing
|
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 |
setStartedProcessingTime(long time)
Sets the started processing time.
|
void addMatchingModel(String MatchingModelName, String WeightingModelName)
MatchingModelName
- the String class name that should be usedWeightingModelName
- the String class name that should be usedvoid setQuery(Query q)
q
- The Query object syntax treevoid setQueryID(String qid)
qid
- the unique string identifierQuery getQuery()
void setControl(String Name, String Value)
Name
- the name of the control to set the value of.Value
- the value that the control should take.String getQueryID()
ResultSet getResultSet()
String getControl(String Name)
boolean isEmpty()
void setOriginalQuery(String q)
String getOriginalQuery()
void setNumberOfDocumentsAfterFiltering(int n)
n
- int getNumberOfDocumentsAfterFiltering()
long getStartedProcessingTime()
void setStartedProcessingTime(long time)
time
- void setContextObject(String key, Object value)
key
- the key of the context objectvalue
- the value of the context objectTerrier 4.0. Copyright © 2004-2014 University of Glasgow