Package org.apache.solr.handler
Class AnalysisRequestHandlerBase
- java.lang.Object
-
- org.apache.solr.handler.RequestHandlerBase
-
- org.apache.solr.handler.AnalysisRequestHandlerBase
-
- All Implemented Interfaces:
AutoCloseable
,ApiSupport
,SolrInfoBean
,NestedRequestHandler
,SolrMetricProducer
,SolrRequestHandler
,PermissionNameProvider
- Direct Known Subclasses:
DocumentAnalysisRequestHandler
,FieldAnalysisRequestHandler
public abstract class AnalysisRequestHandlerBase extends RequestHandlerBase
A base class for all analysis request handlers.- Since:
- solr 1.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AnalysisRequestHandlerBase.AnalysisContext
Serves as the context of an analysis process.protected static class
AnalysisRequestHandlerBase.ListBasedTokenStream
TokenStream that iterates over a list of pre-existing Tokensstatic interface
AnalysisRequestHandlerBase.TokenTrackingAttribute
This is anAttribute
used to track the positions of tokens in the analysis chain.static class
AnalysisRequestHandlerBase.TokenTrackingAttributeImpl
Implementation ofAnalysisRequestHandlerBase.TokenTrackingAttribute
.-
Nested classes/interfaces inherited from class org.apache.solr.handler.RequestHandlerBase
RequestHandlerBase.HandlerMetrics
-
Nested classes/interfaces inherited from interface org.apache.solr.security.PermissionNameProvider
PermissionNameProvider.Name
-
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group
-
-
Field Summary
Fields Modifier and Type Field Description static Set<org.apache.lucene.util.BytesRef>
EMPTY_BYTES_SET
-
Fields inherited from class org.apache.solr.handler.RequestHandlerBase
aggregateNodeLevelMetricsEnabled, appends, defaults, httpCaching, initArgs, invariants, metrics, solrMetricsContext
-
Fields inherited from interface org.apache.solr.security.PermissionNameProvider
ANY, NULL, values
-
Fields inherited from interface org.apache.solr.request.SolrRequestHandler
TYPE
-
-
Constructor Summary
Constructors Constructor Description AnalysisRequestHandlerBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected org.apache.solr.common.util.NamedList<? extends Object>
analyzeValue(String value, AnalysisRequestHandlerBase.AnalysisContext context)
Analyzes the given value using the given Analyzer.protected abstract org.apache.solr.common.util.NamedList
doAnalysis(SolrQueryRequest req)
Performs the analysis based on the given solr request and returns the analysis result as a named list.protected Set<org.apache.lucene.util.BytesRef>
getQueryTokenSet(String query, org.apache.lucene.analysis.Analyzer analyzer)
Analyzes the given text using the given analyzer and returns the produced tokens.void
handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp)
-
Methods inherited from class org.apache.solr.handler.RequestHandlerBase
getApis, getCategory, getDescription, getInitArgs, getMetricsForThisRequest, getName, getPluginInfo, getRequestHandler, getSolrMetricsContext, getSolrParamsFromNamedList, getSubHandler, handleRequest, init, initializeMetrics, setPluginInfo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.api.ApiSupport
registerV1, registerV2
-
Methods inherited from interface org.apache.solr.security.PermissionNameProvider
getPermissionName
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
-
-
-
Field Detail
-
EMPTY_BYTES_SET
public static final Set<org.apache.lucene.util.BytesRef> EMPTY_BYTES_SET
-
-
Method Detail
-
handleRequestBody
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
- Specified by:
handleRequestBody
in classRequestHandlerBase
- Throws:
Exception
-
doAnalysis
protected abstract org.apache.solr.common.util.NamedList doAnalysis(SolrQueryRequest req) throws Exception
Performs the analysis based on the given solr request and returns the analysis result as a named list.- Parameters:
req
- The solr request.- Returns:
- The analysis result as a named list.
- Throws:
Exception
- When analysis fails.
-
analyzeValue
protected org.apache.solr.common.util.NamedList<? extends Object> analyzeValue(String value, AnalysisRequestHandlerBase.AnalysisContext context)
Analyzes the given value using the given Analyzer.- Parameters:
value
- Value to analyzecontext
- Theanalysis context
.- Returns:
- NamedList containing the tokens produced by analyzing the given value
-
-