public interface SearchRequest extends Serializable
IndexRef indexref = IndexRef.of("/path/to/my/index/data.properties"); IManager manager = ManagerFactor.from(indexref); SearchRequest srq = manager.newSearchRequest("my query"); //run the query manager.runSearchRequest(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 | Field and Description |
---|---|
static String |
CONTROL_MATCHING |
static String |
CONTROL_WMODEL |
Modifier and Type | Method and Description |
---|---|
void |
addMatchingModel(String MatchingModelName,
String WeightingModelName)
Deprecated.
|
Object |
getContextObject(String key)
Returns the value of a context object.
|
String |
getControl(String Name)
Returns the value of the control.empty string if not set.
|
default String |
getControl(String Name,
String Default)
Returns the value of the control, or Default if not set.
|
Map<String,String> |
getControls() |
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
|
String |
getQueryID()
Returns the query id as set by setQueryID(String).
|
ScoredDocList |
getResults()
Get the results
|
long |
getStartedProcessingTime()
Returns the time the process start.
|
default boolean |
hasControl(String Name) |
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 |
setQueryID(String qid)
Set a unique identifier for this query request.
|
void |
setStartedProcessingTime(long time)
Sets the started processing time.
|
static final String CONTROL_WMODEL
static final String CONTROL_MATCHING
void addMatchingModel(String MatchingModelName, String WeightingModelName)
MatchingModelName
- the String class name that should be usedWeightingModelName
- the String class name that should be usedvoid setQueryID(String qid)
qid
- the unique string identifiervoid 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()
default boolean hasControl(String Name)
String getControl(String Name)
default String getControl(String Name, String Default)
boolean isEmpty()
void setOriginalQuery(String q)
String getOriginalQuery()
void setNumberOfDocumentsAfterFiltering(int n)
n
- int getNumberOfDocumentsAfterFiltering()
long getStartedProcessingTime()
void setStartedProcessingTime(long time)
time
- ScoredDocList getResults()
void setContextObject(String key, Object value)
key
- the key of the context objectvalue
- the value of the context objectTerrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow