Package org.mycore.solr.search
Class MCRSolrSearchServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.mycore.frontend.servlets.MCRServlet
org.mycore.solr.search.MCRSolrSearchServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
Used to map a formular-post to a solr request.
Parameters
- Solr reserved parameters
- They will directly forwarded to the server.
- Type parameters
- They are used to join other documents in the search. They start with "solr.type.".
- Sort parameters
- They are used to sort the results in the right order. They start with "sort."
- Query parameters
- They are used to build the query for solr. All parameters which are not reserved, type or sort parameters will be stored here.
- Author:
- mcrshofm, mcrsherm
- See Also:
-
Field Summary
Fields inherited from class org.mycore.frontend.servlets.MCRServlet
ATTR_MYCORE_SESSION, CURRENT_THREAD_NAME_KEY, INITIAL_SERVLET_NAME_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildSelectParameterMap
(Map<String, String[]> queryParameters, Map<String, String[]> typeParameters, Map<String, String[]> sortParameters, Set<String> phraseQuery) protected void
doGetPost
(MCRServletJob job) This method should be overwritten by other servlets.protected void
extractParameterList
(Map<String, String[]> requestParameter, Map<String, String[]> queryParameter, Map<String, String[]> solrParameter, Map<String, String[]> typeParameter, Map<String, String[]> sortParameter) Splits the parameters into three groups.void
init()
Methods inherited from class org.mycore.frontend.servlets.MCRServlet
allowCrossDomainRequests, buildRedirectURL, cleanupMCRSession, doGet, doGet, doPost, doPost, getErrorI18N, getLastModified, getLayoutService, getProperty, getReferer, getServletBaseURL, getSession, handleException, initializeMCRSession, render, reportException, think, toReferrer, toReferrer
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, service, service
Methods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
MCRSolrSearchServlet
public MCRSolrSearchServlet()
-
-
Method Details
-
buildSelectParameterMap
protected Map<String,String[]> buildSelectParameterMap(Map<String, String[]> queryParameters, Map<String, throws jakarta.servlet.ServletExceptionString[]> typeParameters, Map<String, String[]> sortParameters, Set<String> phraseQuery) - Parameters:
queryParameters
- all parameter wheregetParameterGroup.equals(QueryParameter)
typeParameters
- all parameter wheregetParameterGroup.equals(TypeParameter)
- Returns:
- a map which can be forwarded to
MCRSolrProxyServlet
- Throws:
jakarta.servlet.ServletException
-
doGetPost
Description copied from class:MCRServlet
This method should be overwritten by other servlets. As a default response we indicate the HTTP 1.1 status code 501 (Not Implemented).- Overrides:
doGetPost
in classMCRServlet
- Throws:
Exception
-
init
public void init() throws jakarta.servlet.ServletException- Overrides:
init
in classMCRServlet
- Throws:
jakarta.servlet.ServletException
-
extractParameterList
protected void extractParameterList(Map<String, String[]> requestParameter, Map<String, String[]> queryParameter, Map<String, String[]> solrParameter, Map<String, String[]> typeParameter, Map<String, String[]> sortParameter) Splits the parameters into three groups.- Parameters:
requestParameter
- the map of parameters to split.queryParameter
- all querys will be stored here.solrParameter
- all solr-parameters will be stored here.typeParameter
- all type-parameters will be stored here.sortParameter
- all sort-parameters will be stored here.
-