public abstract class AnalysisRequestHandlerBase extends RequestHandlerBase
| Modifier and Type | Class and 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 Tokens
|
static interface |
AnalysisRequestHandlerBase.TokenTrackingAttribute
This is an
Attribute used to track the positions of tokens
in the analysis chain. |
static class |
AnalysisRequestHandlerBase.TokenTrackingAttributeImpl
Implementation of
AnalysisRequestHandlerBase.TokenTrackingAttribute. |
SolrInfoMBean.Category| Modifier and Type | Field and Description |
|---|---|
(package private) static java.util.Map<java.lang.String,java.lang.String> |
ATTRIBUTE_MAPPING |
appends, defaults, handlerStart, httpCaching, initArgs, invariants, numErrors, numRequests, numTimeouts, totalTime| Constructor and Description |
|---|
AnalysisRequestHandlerBase() |
| Modifier and Type | Method and Description |
|---|---|
private java.util.List<org.apache.lucene.util.AttributeSource> |
analyzeTokenStream(org.apache.lucene.analysis.TokenStream tokenStream)
Analyzes the given TokenStream, collecting the Tokens it produces.
|
protected NamedList<java.util.List<NamedList>> |
analyzeValue(java.lang.String value,
AnalysisRequestHandlerBase.AnalysisContext context)
Analyzes the given value using the given Analyzer.
|
protected java.util.List<org.apache.lucene.util.AttributeSource> |
analyzeValue(java.lang.String value,
org.apache.lucene.analysis.Analyzer analyzer)
Deprecated.
This method is no longer used by Solr
|
private java.util.List<NamedList> |
convertTokensToNamedLists(java.util.List<org.apache.lucene.util.AttributeSource> tokenList,
AnalysisRequestHandlerBase.AnalysisContext context)
Converts the list of Tokens to a list of NamedLists representing the tokens.
|
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 java.util.Set<java.lang.String> |
getQueryTokenSet(java.lang.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) |
private java.lang.String |
writeCharStream(NamedList out,
org.apache.lucene.analysis.CharStream input) |
getCategory, getDescription, getDocs, getInitArgs, getName, getSource, getSourceId, getStatistics, getVersion, handleRequest, initstatic java.util.Map<java.lang.String,java.lang.String> ATTRIBUTE_MAPPING
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws java.lang.Exception
handleRequestBody in class RequestHandlerBasejava.lang.Exceptionprotected abstract NamedList doAnalysis(SolrQueryRequest req) throws java.lang.Exception
req - The solr request.java.lang.Exception - When analysis fails.protected NamedList<java.util.List<NamedList>> analyzeValue(java.lang.String value, AnalysisRequestHandlerBase.AnalysisContext context)
value - Value to analyzecontext - The analysis context.@Deprecated
protected java.util.List<org.apache.lucene.util.AttributeSource> analyzeValue(java.lang.String value,
org.apache.lucene.analysis.Analyzer analyzer)
value - The value to analyze.analyzer - The analyzer to use.getQueryTokenSet(java.lang.String, org.apache.lucene.analysis.Analyzer)protected java.util.Set<java.lang.String> getQueryTokenSet(java.lang.String query,
org.apache.lucene.analysis.Analyzer analyzer)
query - The query to analyze.analyzer - The analyzer to use.private java.util.List<org.apache.lucene.util.AttributeSource> analyzeTokenStream(org.apache.lucene.analysis.TokenStream tokenStream)
tokenStream - TokenStream to analyzeprivate java.util.List<NamedList> convertTokensToNamedLists(java.util.List<org.apache.lucene.util.AttributeSource> tokenList, AnalysisRequestHandlerBase.AnalysisContext context)
tokens - Tokens to convertcontext - The analysis contextprivate java.lang.String writeCharStream(NamedList out, org.apache.lucene.analysis.CharStream input)