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
A base class for all analysis request handlers.
- Since:
- solr 1.4
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classServes as the context of an analysis process.protected static final classTokenStream that iterates over a list of pre-existing Tokensstatic interfaceThis is anAttributeused to track the positions of tokens in the analysis chain.static final classImplementation ofAnalysisRequestHandlerBase.TokenTrackingAttribute.Nested classes/interfaces inherited from class org.apache.solr.handler.RequestHandlerBase
RequestHandlerBase.HandlerMetricsNested classes/interfaces inherited from interface org.apache.solr.security.PermissionNameProvider
PermissionNameProvider.NameNested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group -
Field Summary
FieldsFields inherited from class org.apache.solr.handler.RequestHandlerBase
aggregateNodeLevelMetricsEnabled, appends, defaults, httpCaching, initArgs, invariants, metrics, publishCpuTime, REQUEST_CPU_TIMER_CONTEXT, solrMetricsContext, SOURCE_ATTRFields inherited from interface org.apache.solr.security.PermissionNameProvider
ANY, NULL, valuesFields inherited from interface org.apache.solr.metrics.SolrMetricProducer
CATEGORY_ATTR, HANDLER_ATTR, NAME_ATTR, OPERATION_ATTR, PLUGIN_NAME_ATTR, RESULT_ATTR, TYPE_ATTRFields inherited from interface org.apache.solr.request.SolrRequestHandler
TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.NamedListPerforms 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.voidMethods inherited from class org.apache.solr.handler.RequestHandlerBase
getApis, getCategory, getDescription, getInitArgs, getMetricsForThisRequest, getName, getPluginInfo, getRequestHandler, getSolrMetricsContext, getSolrParamsFromNamedList, getSubHandler, handleRequest, init, initializeMetrics, isInternalShardRequest, processErrorMetricsOnException, processReceivedException, setPluginInfoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.api.ApiSupport
getJerseyResources, registerV1, registerV2Methods inherited from interface org.apache.solr.security.PermissionNameProvider
getPermissionNameMethods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
Field Details
-
EMPTY_BYTES_SET
-
-
Constructor Details
-
AnalysisRequestHandlerBase
public AnalysisRequestHandlerBase()
-
-
Method Details
-
handleRequestBody
- Specified by:
handleRequestBodyin 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
-
getQueryTokenSet
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.- Parameters:
query- The query to analyze.analyzer- The analyzer to use.
-