public class LocalManager extends Object implements Manager
IndexRef indexRef = IndexRef.of("/path/to/data.properties"); Manager m = ManagerFactory.from(indexRef); SearchRequest srq = m.newSearchRequest("Q1", "term1 title:term2"); m.runSearchRequest(srq);
Properties
Controls
Modifier and Type | Class and Description |
---|---|
static class |
LocalManager.Builder |
Modifier and Type | Field and Description |
---|---|
protected Set<String> |
Allowed_Controls
This contains a list of controls that may be set in the querying API
|
protected Map<String,String> |
Default_Controls
This contains the mapping of controls and their values that should be
set identically 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.slf4j.Logger |
logger |
static String |
NAMESPACE_MATCHING
The default namespace for Matching models to be loaded from
|
static String |
NAMESPACE_POSTFILTER
The default namespace for PostFilters to be loaded from
|
static String |
NAMESPACE_PROCESS
The default namespace for Process instances to be loaded from
|
static String |
NAMESPACE_WEIGHTING
The default namespace for Weighting models to be loaded from
|
protected String |
pipelineOutput
This class is used as a TermPipelineAccessor, and this variable stores
the result of the TermPipeline run for that term.
|
protected TermPipelineAccessor |
tpa
TermPipeline processing
|
Constructor and Description |
---|
LocalManager(Index _index)
Construct a Manager using the specified Index
Throws IllegalArgumentException if the specified index is null
|
Modifier and Type | Method and Description |
---|---|
Index |
getIndex()
Returns the index used by the manager.
|
IndexRef |
getIndexRef() |
String |
getInfo(SearchRequest srq)
Returns information about the weighting models and
the post processors used for the given search request.
|
protected static Model |
getWeightingModel(Request rq)
Returns the weighting model requested by the Request 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
|
SearchRequest |
newSearchRequest()
Ask for new SearchRequest object to be made.
|
SearchRequest |
newSearchRequest(String QueryID)
Ask for new SearchRequest object to be made.
|
SearchRequest |
newSearchRequest(String QueryID,
String query)
Ask for new SearchRequest object to be made, instantiated using the
specified query id, and that the specified query should be parsed.
|
SearchRequest |
newSearchRequestFromQuery(String query)
Ask for new SearchRequest object to be made given a query to be parsed
|
void |
runSearchRequest(SearchRequest srq)
This runs a given SearchRequest through the four retrieval stages and adds the ResultSet to the
SearchRequest object.
|
protected void |
setDefaults(Request srq)
Set the default values for the controls of this new search request
|
void |
setProperties(Properties p)
Set all these properties.
|
void |
setProperty(String key,
String value)
Provide a common interface for changing property values.
|
protected void |
useThisIndex(Index i)
use the index specified for the Manager
|
protected static final org.slf4j.Logger logger
public static final String NAMESPACE_PROCESS
public static final String NAMESPACE_POSTFILTER
public static final String NAMESPACE_MATCHING
public static final String NAMESPACE_WEIGHTING
protected TermPipelineAccessor tpa
protected Index index
protected Set<String> Allowed_Controls
protected Map<String,String> Default_Controls
protected int Defaults_Size
protected String pipelineOutput
public LocalManager(Index _index)
_index
- The index to use in this manageprotected void useThisIndex(Index i)
protected void load_controls_allowed()
protected void load_controls_default()
protected void load_pipeline()
public SearchRequest newSearchRequest()
Manager
newSearchRequest
in interface Manager
public SearchRequest newSearchRequest(String QueryID)
Manager
newSearchRequest
in interface Manager
QueryID
- The request should be identified by QueryIDpublic SearchRequest newSearchRequest(String QueryID, String query)
Manager
newSearchRequest
in interface Manager
QueryID
- The request should be identified by QueryIDquery
- The actual user querypublic SearchRequest newSearchRequestFromQuery(String query)
Manager
newSearchRequestFromQuery
in interface Manager
query
- The actual user queryprotected 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 IndexRef getIndexRef()
getIndexRef
in interface Manager
public void setProperty(String key, String value)
Manager
setProperty
in interface Manager
key
- Key of property to setvalue
- Value of property to setpublic void setProperties(Properties p)
Manager
setProperties
in interface Manager
p
- All properties to setpublic void runSearchRequest(SearchRequest srq)
Manager
runSearchRequest
in interface Manager
srq
- - the SearchRequest to be processedprotected static Model getWeightingModel(Request rq)
rq
- The name of the weighting model to instantiatepublic String getInfo(SearchRequest srq)
srq
- the search request for which we obtain
the information.Terrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow