Package eu.clarin.sru.server.utils
Class SRUSearchEngineBase
- java.lang.Object
-
- eu.clarin.sru.server.utils.SRUSearchEngineBase
-
- All Implemented Interfaces:
SRUSearchEngine
public abstract class SRUSearchEngineBase extends Object implements SRUSearchEngine
Base class required for anSRUSearchEngineimplementation to be used with theSRUServerServletServlet.
-
-
Constructor Summary
Constructors Constructor Description SRUSearchEngineBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroy the search engine.SRUExplainResultexplain(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics)Handle a explain operation.voidinit(javax.servlet.ServletContext context, SRUServerConfig config, SRUQueryParserRegistry.Builder parsersRegistryBuilder, Map<String,String> params)Initialize the search engine.SRUScanResultSetscan(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics)Handle a scan operation.abstract SRUSearchResultSetsearch(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics)Handle a searchRetrieve operation.
-
-
-
Method Detail
-
explain
public SRUExplainResult explain(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics) throws SRUException
Handle a explain operation. The default implementation is a no-op. Override this method, if you want to provide a custom behavior.- Specified by:
explainin interfaceSRUSearchEngine- Parameters:
config- theSRUEndpointConfigobject that contains the endpoint configurationrequest- theSRURequestobject that contains the request made to the endpointdiagnostics- theSRUDiagnosticListobject for storing non-fatal diagnostics- Returns:
- a
SRUExplainResultobject ornullif the search engine does not want to provide writeExtraResponseData - Throws:
SRUException- if an fatal error occurred- See Also:
SRUSearchEngine.explain(SRUServerConfig, SRURequest, SRUDiagnosticList)
-
scan
public SRUScanResultSet scan(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics) throws SRUException
Handle a scan operation. The default implementation is a no-op. Override this method, if you want to provide a custom behavior.- Specified by:
scanin interfaceSRUSearchEngine- Parameters:
config- theSRUEndpointConfigobject that contains the endpoint configurationrequest- theSRURequestobject that contains the request made to the endpointdiagnostics- theSRUDiagnosticListobject for storing non-fatal diagnostics- Returns:
- a
SRUScanResultSetobject ornullif this operation is not supported by this search engine - Throws:
SRUException- if an fatal error occurred- See Also:
SRUSearchEngine.scan(SRUServerConfig, SRURequest, SRUDiagnosticList)
-
search
public abstract SRUSearchResultSet search(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics) throws SRUException
Handle a searchRetrieve operation.- Specified by:
searchin interfaceSRUSearchEngine- Parameters:
config- theSRUEndpointConfigobject that contains the endpoint configurationrequest- theSRURequestobject that contains the request made to the endpointdiagnostics- theSRUDiagnosticListobject for storing non-fatal diagnostics- Returns:
- a
SRUSearchResultSetobject - Throws:
SRUException- if an fatal error occurred- See Also:
SRUSearchEngine.search(SRUServerConfig, SRURequest, SRUDiagnosticList)
-
init
public void init(javax.servlet.ServletContext context, SRUServerConfig config, SRUQueryParserRegistry.Builder parsersRegistryBuilder, Map<String,String> params) throws SRUConfigExceptionInitialize the search engine.- Parameters:
context- theServletContextfor the Servletconfig- theSRUServerConfigobject for this search engineparsersRegistryBuilder- theSRUQueryParserRegistry.Builderobject to be used for this search engine. Use to register additional query parsers with theSRUServer.params- additional parameters gathered from the Servlet configuration and Servlet context.- Throws:
SRUConfigException- an error occurred during initialization of the search engine
-
destroy
public void destroy()
Destroy the search engine. Use this method for any cleanup the search engine needs to perform upon termination.
-
-