public class FieldAnalysisRequestHandler extends AnalysisRequestHandlerBase
Name | Type | required | Description | Multi-valued |
---|---|---|---|---|
analysis.fieldname | string | no | When present, the text will be analyzed based on the type of this field name. | Yes, this parameter may hold a comma-separated list of values and the analysis will be performed for each of the specified fields |
analysis.fieldtype | string | no | When present, the text will be analyzed based on the specified type | Yes, this parameter may hold a comma-separated list of values and the analysis will be performed for each of the specified field types |
analysis.fieldvalue | string | yes | The text that will be analyzed. The analysis will mimic the index-time analysis. | No |
analysis.query OR q |
string | no | When present, the text that will be analyzed. The analysis will mimic the query-time analysis. Note that the
analysis.query parameter as precedes the q parameters. |
No |
analysis.showmatch | boolean | no | When set to true and when query analysis is performed, the produced tokens of the field value
analysis will be marked as "matched" for every token that is produces by the query analysis |
No |
Note that if neither analysis.fieldname and analysis.fieldtype is specified, then the default search field's analyzer is used.
AnalysisRequestHandlerBase.AnalysisContext, AnalysisRequestHandlerBase.ListBasedTokenStream, AnalysisRequestHandlerBase.TokenTrackingAttribute, AnalysisRequestHandlerBase.TokenTrackingAttributeImpl
SolrInfoMBean.Category
ATTRIBUTE_MAPPING
appends, defaults, handlerStart, httpCaching, initArgs, invariants, numErrors, numRequests, numTimeouts, totalTime
Constructor and Description |
---|
FieldAnalysisRequestHandler() |
Modifier and Type | Method and Description |
---|---|
private NamedList<NamedList> |
analyzeValues(FieldAnalysisRequest analysisRequest,
FieldType fieldType,
java.lang.String fieldName)
Analyzes the index value (if it exists) and the query value (if it exists) in the given AnalysisRequest, using
the Analyzers of the given field type.
|
protected NamedList |
doAnalysis(SolrQueryRequest req)
Performs the analysis based on the given solr request and returns the analysis result as a named list.
|
java.lang.String |
getDescription()
Simple one or two line description
|
java.lang.String |
getSource()
CVS Source, SVN Source, etc
|
java.lang.String |
getSourceId()
CVS Id, SVN Id, etc
|
java.lang.String |
getVersion()
Simple common usage version, e.g.
|
protected NamedList<NamedList> |
handleAnalysisRequest(FieldAnalysisRequest request,
IndexSchema schema)
Handles the resolved analysis request and returns the analysis breakdown response as a named list.
|
(package private) FieldAnalysisRequest |
resolveAnalysisRequest(SolrQueryRequest req)
Resolves the AnalysisRequest based on the parameters in the given SolrParams.
|
analyzeValue, analyzeValue, getQueryTokenSet, handleRequestBody
getCategory, getDocs, getInitArgs, getName, getStatistics, handleRequest, init
protected NamedList doAnalysis(SolrQueryRequest req) throws java.lang.Exception
doAnalysis
in class AnalysisRequestHandlerBase
req
- The solr request.java.lang.Exception
- When analysis fails.public java.lang.String getDescription()
SolrInfoMBean
getDescription
in interface SolrInfoMBean
getDescription
in class RequestHandlerBase
public java.lang.String getVersion()
SolrInfoMBean
getVersion
in interface SolrInfoMBean
getVersion
in class RequestHandlerBase
public java.lang.String getSourceId()
SolrInfoMBean
getSourceId
in interface SolrInfoMBean
getSourceId
in class RequestHandlerBase
public java.lang.String getSource()
SolrInfoMBean
getSource
in interface SolrInfoMBean
getSource
in class RequestHandlerBase
FieldAnalysisRequest resolveAnalysisRequest(SolrQueryRequest req)
req
- the requestprotected NamedList<NamedList> handleAnalysisRequest(FieldAnalysisRequest request, IndexSchema schema)
request
- The request to handle.schema
- The index schema.private NamedList<NamedList> analyzeValues(FieldAnalysisRequest analysisRequest, FieldType fieldType, java.lang.String fieldName)
analysisRequest
- AnalysisRequest from where the index and query values will be takenfieldType
- Type of field whose analyzers will be usedfieldName
- Name of the field to be analyzed. Can be null