Package org.apache.solr.handler
Class AnalysisRequestHandlerBase
- java.lang.Object
-
- org.apache.solr.handler.RequestHandlerBase
-
- org.apache.solr.handler.AnalysisRequestHandlerBase
-
- All Implemented Interfaces:
ApiSupport
,SolrInfoBean
,NestedRequestHandler
,SolrMetricProducer
,SolrRequestHandler
- 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 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
appends, defaults, httpCaching, initArgs, invariants, metricManager, registryName
-
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 NamedList<? extends Object>
analyzeValue(String value, AnalysisRequestHandlerBase.AnalysisContext context)
Analyzes the given value using the given Analyzer.protected abstract 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, getMetricNames, getMetricRegistry, getName, getPluginInfo, getRequestHandler, 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.core.SolrInfoBean
getMetricsSnapshot, registerMetricName
-
-
-
-
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 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 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
-
-