Class SearchHandler
java.lang.Object
org.apache.solr.handler.RequestHandlerBase
org.apache.solr.handler.component.SearchHandler
- All Implemented Interfaces:
AutoCloseable,ApiSupport,SolrInfoBean,NestedRequestHandler,SolrMetricProducer,SolrRequestHandler,PermissionNameProvider,PluginInfoInitialized,SolrCoreAware
- Direct Known Subclasses:
ExportHandler,RealTimeGetHandler,StandardRequestHandler
public class SearchHandler
extends RequestHandlerBase
implements SolrCoreAware, PluginInfoInitialized, PermissionNameProvider
Refer SOLR-281
-
Nested Class Summary
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
FieldsModifier and TypeFieldDescriptionprotected List<SearchComponent> static final io.opentelemetry.api.common.AttributeKey<Boolean> Fields 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 booleancheckCircuitBreakers(SolrQueryRequest req, SolrQueryResponse rsp, ResponseBuilder rb) Check ifSolrRequest.SolrRequestType.QUERYcircuit breakers are tripped.Simple one or two line descriptionThe metrics to be used for this request.static StringReturns a String to use as an identifier for this request.voidvoidInitialize the components based on name.voidinit(PluginInfo info) voidinitializeMetrics(SolrMetricsContext parentContext, io.opentelemetry.api.common.Attributes attributes) Implementation should initialize all metrics to aSolrMetricsContextRegistry/MeterProvider withAttributesas the common set of attributes that will be attached to every metric that is initialized for that class/componentprotected ResponseBuildernewResponseBuilder(SolrQueryRequest req, SolrQueryResponse rsp, List<SearchComponent> components) Override this method if you require a customResponseBuildere.g.Whether this request handler must be made available at the /v2/ pathprotected StringstageToString(int stage) Methods inherited from class org.apache.solr.handler.RequestHandlerBase
getApis, getCategory, getInitArgs, getName, getPluginInfo, getRequestHandler, getSolrMetricsContext, getSolrParamsFromNamedList, getSubHandler, handleRequest, init, 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, registerV1Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
Field Details
-
INTERNAL_ATTR
-
components
-
-
Constructor Details
-
SearchHandler
public SearchHandler()
-
-
Method Details
-
getDefaultComponents
-
init
- Specified by:
initin interfacePluginInfoInitialized
-
initializeMetrics
public void initializeMetrics(SolrMetricsContext parentContext, io.opentelemetry.api.common.Attributes attributes) Description copied from interface:SolrMetricProducerImplementation should initialize all metrics to aSolrMetricsContextRegistry/MeterProvider withAttributesas the common set of attributes that will be attached to every metric that is initialized for that class/component- Specified by:
initializeMetricsin interfaceSolrMetricProducer- Overrides:
initializeMetricsin classRequestHandlerBase- Parameters:
parentContext- The registry that the component will initialize metrics toattributes- Base set of attributes that will be bound to all metrics for that component
-
getMetricsForThisRequest
Description copied from class:RequestHandlerBaseThe metrics to be used for this request.- Overrides:
getMetricsForThisRequestin classRequestHandlerBase
-
getPermissionName
- Specified by:
getPermissionNamein interfacePermissionNameProvider
-
inform
Initialize the components based on name. Note, if usingINIT_FIRST_COMPONENTSorINIT_LAST_COMPONENTS, then theDebugComponentwill always occur last. If this is not desired, then one must explicitly declare all components using theINIT_COMPONENTSsyntax.- Specified by:
informin interfaceSolrCoreAware
-
getComponents
-
getAndPrepShardHandler
-
newResponseBuilder
protected ResponseBuilder newResponseBuilder(SolrQueryRequest req, SolrQueryResponse rsp, List<SearchComponent> components) Override this method if you require a customResponseBuildere.g. for use by a customSearchComponent. -
checkCircuitBreakers
protected boolean checkCircuitBreakers(SolrQueryRequest req, SolrQueryResponse rsp, ResponseBuilder rb) Check ifSolrRequest.SolrRequestType.QUERYcircuit breakers are tripped. Override this method in sub classes that do not want to check circuit breakers.- Returns:
- true if circuit breakers are tripped, false otherwise.
-
handleRequestBody
- Specified by:
handleRequestBodyin classRequestHandlerBase- Throws:
Exception
-
stageToString
-
getOrGenerateRequestId
Returns a String to use as an identifier for this request.If the provided
SolrQueryRequestcontains a non-blankCommonParams.REQUEST_IDparam value this is used. This is especially useful for users who deploy Solr as one component in a larger ecosystem, and want to use an external ID utilized by other components as well. If noCommonParams.REQUEST_IDvalue is present, one is generated from scratch for the request.Callers are responsible for storing the returned value in the
SolrQueryRequestobject if they want to ensure that ID generation is not redone on subsequent calls. -
getDescription
Description copied from interface:SolrInfoBeanSimple one or two line description- Specified by:
getDescriptionin interfaceSolrInfoBean- Specified by:
getDescriptionin classRequestHandlerBase
-
registerV2
Description copied from interface:ApiSupportWhether this request handler must be made available at the /v2/ path- Specified by:
registerV2in interfaceApiSupport
-