|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.querying.Manager
public class Manager
This class is responsible for handling/co-ordinating the main high-level operations of a query. These are:
Manager m = new Manager(index); SearchRequest srq = m.newSearchRequest("Q1", "term1 title:term2"); m.runPreProcessing(srq); m.runMatching(srq); m.runPostProcess(srq); m.runPostFilters(srq);
Properties
Controls
Field Summary | |
---|---|
protected java.util.Set<java.lang.String> |
Allowed_Controls
This contains a list of controls that may be set in the querying API |
protected java.util.Map<Index,java.util.Map<java.lang.String,Matching>> |
Cache_Matching
Cache loaded Matching models per Index in this map |
protected java.util.Map<java.lang.String,PostFilter> |
Cache_PostFilter
Cache loaded PostFitler models in this map |
protected java.util.Map<java.lang.String,PostProcess> |
Cache_PostProcess
Cache loaded PostProcess models in this map |
protected java.util.Map<java.lang.String,Process> |
Cache_PreProcess
Cache loaded PostProcess models in this map |
protected boolean |
CACHING_FILTERS
|
protected java.util.Map<java.lang.String,java.lang.String> |
Default_Controls
This contains the mapping of controls and their values that should be set identially for each query created by this Manager |
protected int |
Defaults_Size
How many default controls exist. |
protected Index |
index
The index this querying comes from |
protected static org.apache.log4j.Logger |
logger
|
protected boolean |
MATCH_EMPTY_QUERY
|
static java.lang.String |
NAMESPACE_MATCHING
The default namespace for Matching models to be loaded from |
static java.lang.String |
NAMESPACE_POSTFILTER
The default namespace for PostFilters to be loaded from |
static java.lang.String |
NAMESPACE_POSTPROCESS
The default namespace for PostProcesses to be loaded from |
static java.lang.String |
NAMESPACE_PREPROCESS
The default namespace for PreProcesses to be loaded from |
static java.lang.String |
NAMESPACE_WEIGHTING
The default namespace for Weighting models to be loaded from |
protected java.lang.String |
pipelineOutput
This class is used as a TermPipelineAccessor, and this variable stores the result of the TermPipeline run for that term. |
protected java.lang.String[][] |
PostFilters_Controls
A 2d array, contains (on 2nd level) the list of controls that turn on the PostFilters at the same 1st level place on PostFilters_Order |
protected java.lang.String[] |
PostFilters_Order
An ordered list of post filters names. |
protected java.lang.String[][] |
PostProcesses_Controls
A 2d array, contains (on 2nd level) the list of controls that turn on the PostProcesses at the same 1st level place on PostProcesses_Order |
protected java.lang.String[] |
PostProcesses_Order
An ordered list of post process names. |
protected java.lang.String[][] |
PreProcesses_Controls
A 2d array, contains (on 2nd level) the list of controls that turn on the PostProcesses at the same 1st level place on PostProcesses_Order |
protected java.lang.String[] |
PreProcesses_Order
An ordered list of post process names. |
protected static java.lang.String[][] |
tinyDoubleStringArray
|
protected static java.lang.String[] |
tinySingleStringArray
|
protected TermPipelineAccessor |
tpa
TermPipeline processing |
Constructor Summary | |
---|---|
Manager()
Default constructor. |
|
Manager(Index _index)
Construct a Manager using the specified Index Throws IllegalArgumentException if the specified index is null |
Method Summary | |
---|---|
Index |
getIndex()
Returns the index used by the manager. |
java.lang.String |
getInfo(SearchRequest srq)
Returns information about the weighting models and the post processors used for the given search request. |
protected Matching |
getMatchingModel(Request rq)
Returns the matching model indicated to be used, based on the Index and the Matching name specified in the passed Request object. |
protected PostFilter |
getPostFilterModule(java.lang.String Name)
Returns the post filter class named ModelName. |
protected PostProcess |
getPostProcessModule(java.lang.String Name)
Returns the PostProcess named Name. |
protected Process |
getPreProcessModule(java.lang.String Name)
Returns the PostProcess named Name. |
protected Model |
getWeightingModel(Request rq)
Returns the weighting model requested by the Reqes from the WeightingModel factory. |
protected void |
load_controls_allowed()
load in the controls that user is allowed to set |
protected void |
load_controls_default()
load in the control defaults |
protected void |
load_pipeline()
load in the term pipeline |
protected void |
load_postfilters_controls()
load in the allowed post filter controls, and the order to run post processes in |
protected void |
load_postprocess_controls()
load in the allowed postprocceses controls, and the order to run post processes in |
protected void |
load_preprocess_controls()
load in the allowed postprocceses controls, and the order to run post processes in |
SearchRequest |
newSearchRequest()
Ask for new SearchRequest object to be made. |
SearchRequest |
newSearchRequest(java.lang.String QueryID)
Ask for new SearchRequest object to be made. |
SearchRequest |
newSearchRequest(java.lang.String QueryID,
java.lang.String query)
Ask for new SearchRequest object to be made, instantiated using the specified query id, and that the specified query should be parsed. |
void |
runMatching(SearchRequest srq)
Runs the weighting and matching stage - this the main entry into the rest of the Terrier framework. |
void |
runPostFilters(SearchRequest srq)
Runs the PostFilter modules in order added. |
void |
runPostProcessing(SearchRequest srq)
Runs the PostProcessing modules in order added. |
void |
runPreProcessing(SearchRequest srq)
runPreProcessing |
protected void |
setDefaults(Request srq)
Set the default values for the controls of this new search request |
void |
setProperties(java.util.Properties p)
Set all these properties. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Provide a common interface for changing property values. |
protected void |
useThisIndex(Index i)
use the index specified for the Manager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger logger
public static final java.lang.String NAMESPACE_POSTPROCESS
public static final java.lang.String NAMESPACE_PREPROCESS
public static final java.lang.String NAMESPACE_POSTFILTER
public static final java.lang.String NAMESPACE_MATCHING
public static final java.lang.String NAMESPACE_WEIGHTING
protected java.util.Map<Index,java.util.Map<java.lang.String,Matching>> Cache_Matching
protected java.util.Map<java.lang.String,PostProcess> Cache_PostProcess
protected java.util.Map<java.lang.String,Process> Cache_PreProcess
protected java.util.Map<java.lang.String,PostFilter> Cache_PostFilter
protected TermPipelineAccessor tpa
protected Index index
protected java.util.Set<java.lang.String> Allowed_Controls
protected java.util.Map<java.lang.String,java.lang.String> Default_Controls
protected int Defaults_Size
protected java.lang.String[] PostProcesses_Order
protected java.lang.String[][] PostProcesses_Controls
protected java.lang.String[] PreProcesses_Order
protected java.lang.String[][] PreProcesses_Controls
protected java.lang.String[] PostFilters_Order
protected java.lang.String[][] PostFilters_Controls
protected java.lang.String pipelineOutput
protected boolean CACHING_FILTERS
protected final boolean MATCH_EMPTY_QUERY
protected static final java.lang.String[] tinySingleStringArray
protected static final java.lang.String[][] tinyDoubleStringArray
Constructor Detail |
---|
public Manager()
public Manager(Index _index)
_index
- The index to use in this manageMethod Detail |
---|
protected void useThisIndex(Index i)
protected void load_controls_allowed()
protected void load_controls_default()
protected void load_postprocess_controls()
protected void load_preprocess_controls()
protected void load_postfilters_controls()
protected void load_pipeline()
public SearchRequest newSearchRequest()
public SearchRequest newSearchRequest(java.lang.String QueryID)
QueryID
- The request should be identified by QueryIDpublic SearchRequest newSearchRequest(java.lang.String QueryID, java.lang.String query)
QueryID
- The request should be identified by QueryIDquery
- The actual user query
protected void setDefaults(Request srq)
srq
- The search request to have the default set to. This is
done using the Default_Controls table, which is loaded by the load_controls_default
method. The default are set in the properties file, by the querying.default.controlspublic Index getIndex()
public void setProperty(java.lang.String key, java.lang.String value)
key
- Key of property to setvalue
- Value of property to setpublic void setProperties(java.util.Properties p)
p
- All properties to setpublic void runPreProcessing(SearchRequest srq)
public void runMatching(SearchRequest srq)
srq
- the current SearchRequest object.public void runPostProcessing(SearchRequest srq)
srq
- the current SearchRequest object.public void runPostFilters(SearchRequest srq)
srq
- the current SearchRequest object.protected Matching getMatchingModel(Request rq)
rq
- The request indicating the Matching class, and the corresponding
instance to use
protected Model getWeightingModel(Request rq)
rq
- The name of the weighting model to instantiateprotected PostProcess getPostProcessModule(java.lang.String Name)
Name
- The name of the post process to return.protected Process getPreProcessModule(java.lang.String Name)
Name
- The name of the post process to return.protected PostFilter getPostFilterModule(java.lang.String Name)
Name
- The name of the post filter to returnpublic java.lang.String getInfo(SearchRequest srq)
srq
- the search request for which we obtain
the information.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |