{"id":1859,"date":"2021-05-31T05:54:54","date_gmt":"2021-05-31T05:54:54","guid":{"rendered":"https:\/\/www.aeologic.com\/blog\/?p=1859"},"modified":"2021-05-31T05:54:54","modified_gmt":"2021-05-31T05:54:54","slug":"requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide","status":"publish","type":"post","link":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/","title":{"rendered":"RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide"},"content":{"rendered":"<section id=\"preamble\" aria-label=\"Preamble\">After the\u00a0<code>&lt;query&gt;<\/code>\u00a0section of\u00a0<code>solrconfig.xml<\/code>, request handlers and search components are configured.A\u00a0<em>request handler<\/em>\u00a0processes requests coming to Solr. These might be query requests or index update requests. You will likely need several of these defined, depending on how you want Solr to handle the various requests you will make.A\u00a0<em>search component<\/em>\u00a0is a feature of search, such as highlighting or faceting. The search component is defined in\u00a0<code>solrconfig.xml<\/code>\u00a0separate from the request handlers, and then registered with a request handler as needed.These are often referred to as &#8220;requestHandler&#8221; and &#8220;searchComponent&#8221;, which is how they are defined in\u00a0<code>solrconfig.xml<\/code>.<\/section>\n<section class=\"sect1\">\n<h2 id=\"request-handlers\">Request Handlers<\/h2>\n<p>Every request handler is defined with a name and a class. The name of the request handler is referenced with the request to Solr, typically as a path. For example, if Solr is installed at\u00a0<code>http:\/\/localhost:8983\/solr\/<\/code>\u00a0and you have a collection named &#8220;gettingstarted&#8221;, you can make a request that looks like this:<\/p>\n<div class=\"listingblock\">\n<pre class=\"rouge highlight\"><code class=\"language-text\" data-lang=\"text\"><\/code><\/pre>\n<pre class=\"highlight\"><code>http:\/\/localhost:8983\/solr\/gettingstarted\/select?q=solr<\/code><\/pre>\n<pre class=\"rouge highlight\"><code class=\"language-text\" data-lang=\"text\"><\/code><\/pre>\n<\/div>\n<p>This query will be processed by the request handler with the name\u00a0<code>\/select<\/code>. We\u2019ve only used the &#8220;q&#8221; parameter here, which includes our query term, a simple keyword of &#8220;solr&#8221;. If the request handler has more parameters defined, those will be used with any query we send to this request handler unless they are over-ridden by the client (or user) in the query itself.<\/p>\n<p>If you have another request handler defined, you would send your request with that name. For example,\u00a0<code>\/update<\/code>\u00a0is a request handler that handles index updates (i.e., sending new documents to the index). By default,\u00a0<code>\/select<\/code>\u00a0is a request handler that handles query requests.<\/p>\n<p>Request handlers can also process requests for nested paths of their names, for example, a request using\u00a0<code>\/myhandler\/extrapath<\/code>\u00a0may be processed by a request handler registered with the name\u00a0<code>\/myhandler<\/code>. If a request handler is explicitly defined by the name\u00a0<code>\/myhandler\/extrapath<\/code>, that would take precedence over the nested path. This assumes you are using the request handler classes included with Solr; if you create your own request handler, you should make sure it includes the ability to handle nested paths if you want to use them with your custom request handler.<\/p>\n<p>It is also possible to configure defaults for request handlers with a section called\u00a0<code>initParams<\/code>. These defaults can be used when you want to have common properties that will be used by each separate handler. For example, if you intend to create several request handlers that will all request the same list of fields in the response, you can configure an\u00a0<code>initParams<\/code>\u00a0section with your list of fields. For more information about\u00a0<code>initParams<\/code>, see the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/initparams-in-solrconfig.html#initparams-in-solrconfig\">InitParams in SolrConfig<\/a>.<\/p>\n<section class=\"sect2\">\n<h3 id=\"searchhandlers\">SearchHandlers<\/h3>\n<p>The primary request handler defined with Solr by default is the &#8220;SearchHandler&#8221;, which handles search queries. The request handler is defined, and then a list of defaults for the handler are defined with a\u00a0<code>defaults<\/code>\u00a0list.<\/p>\n<p>For example, in the default\u00a0<code>solrconfig.xml<\/code>, the first request handler defined looks like this:<\/p>\n<div class=\"listingblock\">\n<pre class=\"rouge highlight\"><code class=\"language-xml\" data-lang=\"xml\"><\/code><\/pre>\n<pre class=\"highlight\"><code>&lt;requestHandler name=\"\/select\" class=\"solr.SearchHandler\"&gt;\r\n  &lt;lst name=\"defaults\"&gt;\r\n    &lt;str name=\"echoParams\"&gt;explicit&lt;\/str&gt;\r\n    &lt;int name=\"rows\"&gt;10&lt;\/int&gt;\r\n  &lt;\/lst&gt;\r\n&lt;\/requestHandler&gt;<\/code><\/pre>\n<pre class=\"rouge highlight\"><code class=\"language-xml\" data-lang=\"xml\"><\/code><\/pre>\n<\/div>\n<p>This example defines the\u00a0<code>rows<\/code>\u00a0parameter, which defines how many search results to return, to &#8220;10&#8221;. The\u00a0<code>echoParams<\/code>\u00a0parameter defines that the parameters defined in the query should be returned when debug information is returned. Note also that the way the defaults are defined in the list varies if the parameter is a string, an integer, or another type.<\/p>\n<p>All of the parameters described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/searching.html#searching\">Searching<\/a>\u00a0can be defined as defaults for any of the SearchHandlers.<\/p>\n<p>Besides\u00a0<code>defaults<\/code>, there are other options for the SearchHandler, which are:<\/p>\n<div class=\"ulist\">\n<ul>\n<li><code>appends<\/code>: This allows definition of parameters that are added to the user query. These might be\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/common-query-parameters.html#fq-filter-query-parameter\">filter queries<\/a>, or other query rules that should be added to each query. There is no mechanism in Solr to allow a client to override these additions, so you should be absolutely sure you always want these parameters applied to queries.\n<div class=\"listingblock\">\n<pre class=\"rouge highlight\"><code class=\"language-xml\" data-lang=\"xml\"><\/code><\/pre>\n<pre class=\"highlight\"><code>&lt;lst name=\"appends\"&gt;\r\n  &lt;str name=\"fq\"&gt;inStock:true&lt;\/str&gt;\r\n&lt;\/lst&gt;<\/code><\/pre>\n<pre class=\"rouge highlight\"><code class=\"language-xml\" data-lang=\"xml\"><\/code><\/pre>\n<\/div>\n<p>In this example, the filter query &#8220;inStock:true&#8221; will always be added to every query.<\/p>\n<p>&nbsp;<\/li>\n<li><code>invariants<\/code>: This allows definition of parameters that cannot be overridden by a client. The values defined in an\u00a0<code>invariants<\/code>\u00a0section will always be used regardless of the values specified by the user, by the client, in\u00a0<code>defaults<\/code>\u00a0or in\u00a0<code>appends<\/code>.\n<div class=\"listingblock\">\n<pre class=\"rouge highlight\"><code class=\"language-xml\" data-lang=\"xml\"><\/code><\/pre>\n<pre class=\"highlight\"><code>&lt;lst name=\"invariants\"&gt;\r\n  &lt;str name=\"facet.field\"&gt;cat&lt;\/str&gt;\r\n  &lt;str name=\"facet.field\"&gt;manu_exact&lt;\/str&gt;\r\n  &lt;str name=\"facet.query\"&gt;price:[* TO 500]&lt;\/str&gt;\r\n  &lt;str name=\"facet.query\"&gt;price:[500 TO *]&lt;\/str&gt;\r\n&lt;\/lst&gt;<\/code><\/pre>\n<pre class=\"rouge highlight\"><code class=\"language-xml\" data-lang=\"xml\"><\/code><\/pre>\n<\/div>\n<p>In this example, facet fields have been defined which limits the facets that will be returned by Solr. If the client requests facets, the facets defined with a configuration like this are the only facets they will see.<\/p>\n<p>&nbsp;<\/li>\n<\/ul>\n<\/div>\n<p>The final section of a request handler definition is\u00a0<code>components<\/code>, which defines a list of search components that can be used with a request handler. They are only registered with the request handler. How to define a search component is discussed further on in the section on\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/requesthandlers-and-searchcomponents-in-solrconfig.html#search-components\">Search Components<\/a>\u00a0below. The\u00a0<code>components<\/code>\u00a0element can only be used with a request handler that is a SearchHandler.<\/p>\n<p>The\u00a0<code>solrconfig.xml<\/code>\u00a0file includes many other examples of SearchHandlers that can be used or modified as needed.<\/p>\n<\/section>\n<section class=\"sect2\">\n<h3 id=\"updaterequesthandlers\">UpdateRequestHandlers<\/h3>\n<p>The UpdateRequestHandlers are request handlers which process updates to the index.<\/p>\n<p>In this guide, we\u2019ve covered these handlers in detail in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/uploading-data-with-index-handlers.html#uploading-data-with-index-handlers\">Uploading Data with Index Handlers<\/a>.<\/p>\n<\/section>\n<section class=\"sect2\">\n<h3 id=\"shardhandlers\">ShardHandlers<\/h3>\n<p>It is possible to configure a request handler to search across shards of a cluster, used with distributed search. More information about distributed search and how to configure the shardHandler is in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/distributed-search-with-index-sharding.html#distributed-search-with-index-sharding\">Distributed Search with Index Sharding<\/a>.<\/p>\n<\/section>\n<section class=\"sect2\">\n<h3 id=\"implicit-request-handlers\">Implicit Request Handlers<\/h3>\n<p>Solr includes many out-of-the-box request handlers that are not configured in\u00a0<code>solrconfig.xml<\/code>, and so are referred to as &#8220;implicit&#8221; &#8211; see\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/implicit-requesthandlers.html#implicit-requesthandlers\">Implicit RequestHandlers<\/a>.<\/p>\n<\/section>\n<\/section>\n<section class=\"sect1\">\n<h2 id=\"search-components\">Search Components<\/h2>\n<p>Search components define the logic that is used by the SearchHandler to perform queries for users.<\/p>\n<section class=\"sect2\">\n<h3 id=\"default-components\">Default Components<\/h3>\n<p>There are several default search components that work with all SearchHandlers without any additional configuration. If no components are defined (with the exception of\u00a0<code>first-components<\/code>\u00a0and\u00a0<code>last-components<\/code>\u00a0&#8211; see below), these are executed by default, in the following order:<\/p>\n<div class=\"tableblock\">\n<table class=\"frame-all grid-all spread\">\n<colgroup>\n<col \/>\n<col \/>\n<col \/><\/colgroup>\n<thead>\n<tr>\n<th class=\"halign-left valign-top\">Component Name<\/th>\n<th class=\"halign-left valign-top\">Class Name<\/th>\n<th class=\"halign-left valign-top\">More Information<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"halign-left valign-top\">query<\/td>\n<td class=\"halign-left valign-top\"><code>solr.QueryComponent<\/code><\/td>\n<td class=\"halign-left valign-top\">Described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/query-syntax-and-parsing.html#query-syntax-and-parsing\">Query Syntax and Parsing<\/a>.<\/td>\n<\/tr>\n<tr>\n<td class=\"halign-left valign-top\">facet<\/td>\n<td class=\"halign-left valign-top\"><code>solr.FacetComponent<\/code><\/td>\n<td class=\"halign-left valign-top\">Described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/faceting.html#faceting\">Faceting<\/a>.<\/td>\n<\/tr>\n<tr>\n<td class=\"halign-left valign-top\">mlt<\/td>\n<td class=\"halign-left valign-top\"><code>solr.MoreLikeThisComponent<\/code><\/td>\n<td class=\"halign-left valign-top\">Described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/morelikethis.html#morelikethis\">MoreLikeThis<\/a>.<\/td>\n<\/tr>\n<tr>\n<td class=\"halign-left valign-top\">highlight<\/td>\n<td class=\"halign-left valign-top\"><code>solr.HighlightComponent<\/code><\/td>\n<td class=\"halign-left valign-top\">Described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/highlighting.html#highlighting\">Highlighting<\/a>.<\/td>\n<\/tr>\n<tr>\n<td class=\"halign-left valign-top\">stats<\/td>\n<td class=\"halign-left valign-top\"><code>solr.StatsComponent<\/code><\/td>\n<td class=\"halign-left valign-top\">Described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/the-stats-component.html#the-stats-component\">The Stats Component<\/a>.<\/td>\n<\/tr>\n<tr>\n<td class=\"halign-left valign-top\">debug<\/td>\n<td class=\"halign-left valign-top\"><code>solr.DebugComponent<\/code><\/td>\n<td class=\"halign-left valign-top\">Described in the section on\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/common-query-parameters.html#debug-parameter\">Common Query Parameters<\/a>.<\/td>\n<\/tr>\n<tr>\n<td class=\"halign-left valign-top\">expand<\/td>\n<td class=\"halign-left valign-top\"><code>solr.ExpandComponent<\/code><\/td>\n<td class=\"halign-left valign-top\">Described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/collapse-and-expand-results.html#collapse-and-expand-results\">Collapse and Expand Results<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>If you register a new search component with one of these default names, the newly defined component will be used instead of the default.<\/p>\n<\/section>\n<section class=\"sect2\">\n<h3 id=\"first-components-and-last-components\">First-Components and Last-Components<\/h3>\n<p>It\u2019s possible to define some components as being used before (with\u00a0<code>first-components<\/code>) or after (with\u00a0<code>last-components<\/code>) the default components listed above.<\/p>\n<div class=\"admonitionblock important\">\n<table>\n<tbody>\n<tr>\n<td class=\"icon\"><\/td>\n<td class=\"content\"><code>first-components<\/code>\u00a0and\/or\u00a0<code>last-components<\/code>\u00a0may only be used in conjunction with the default components. If you define your own\u00a0<code>components<\/code>, the default components will not be executed, and\u00a0<code>first-components<\/code>\u00a0and\u00a0<code>last-components<\/code>\u00a0are disallowed.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"listingblock\">\n<pre class=\"rouge highlight\"><code class=\"language-xml\" data-lang=\"xml\"><\/code><\/pre>\n<pre class=\"highlight\"><code>&lt;arr name=\"first-components\"&gt;\r\n  &lt;str&gt;mycomponent&lt;\/str&gt;\r\n&lt;\/arr&gt;\r\n&lt;arr name=\"last-components\"&gt;\r\n  &lt;str&gt;spellcheck&lt;\/str&gt;\r\n&lt;\/arr&gt;<\/code><\/pre>\n<pre class=\"rouge highlight\"><code class=\"language-xml\" data-lang=\"xml\"><\/code><\/pre>\n<\/div>\n<\/section>\n<section class=\"sect2\">\n<h3 id=\"components\">Components<\/h3>\n<p>If you define\u00a0<code>components<\/code>, the default components (see above) will not be executed, and\u00a0<code>first-components<\/code>\u00a0and\u00a0<code>last-components<\/code>\u00a0are disallowed:<\/p>\n<div class=\"listingblock\">\n<pre class=\"rouge highlight\"><code class=\"language-xml\" data-lang=\"xml\"><\/code><\/pre>\n<pre class=\"highlight\"><code>&lt;arr name=\"components\"&gt;\r\n  &lt;str&gt;mycomponent&lt;\/str&gt;\r\n  &lt;str&gt;query&lt;\/str&gt;\r\n  &lt;str&gt;debug&lt;\/str&gt;\r\n&lt;\/arr&gt;<\/code><\/pre>\n<pre class=\"rouge highlight\"><code class=\"language-xml\" data-lang=\"xml\"><\/code><\/pre>\n<\/div>\n<\/section>\n<section class=\"sect2\">\n<h3 id=\"other-useful-components\">Other Useful Components<\/h3>\n<p>Many of the other useful components are described in sections of this Guide for the features they support. These are:<\/p>\n<div class=\"ulist\">\n<ul>\n<li><code>SpellCheckComponent<\/code>, described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/spell-checking.html#spell-checking\">Spell Checking<\/a>.<\/li>\n<li><code>TermVectorComponent<\/code>, described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/the-term-vector-component.html#the-term-vector-component\">The Term Vector Component<\/a>.<\/li>\n<li><code>QueryElevationComponent<\/code>, described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/the-query-elevation-component.html#the-query-elevation-component\">The Query Elevation Component<\/a>.<\/li>\n<li><code>TermsComponent<\/code>, described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/the-terms-component.html#the-terms-component\">The Terms Component<\/a>.<\/li>\n<li><code>RealTimeGetComponent<\/code>, described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/realtime-get.html#realtime-get\">RealTime Get<\/a>.<\/li>\n<li><code>ClusteringComponent<\/code>, described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/result-clustering.html#result-clustering\">Result Clustering<\/a>.<\/li>\n<li><code>SuggestComponent<\/code>, described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/suggester.html#suggester\">Suggester<\/a>.<\/li>\n<li><code>AnalyticsComponent<\/code>, described in the section\u00a0<a href=\"https:\/\/solr.apache.org\/guide\/8_7\/analytics.html#analytics\">Analytics<\/a>.<\/li>\n<\/ul>\n<\/div>\n<p>Other components that ship with Solr include:<\/p>\n<div class=\"ulist\">\n<ul>\n<li><code>ResponseLogComponent<\/code>, used to record which documents are returned to the user via the Solr log, described in the\u00a0<a href=\"https:\/\/lucene.apache.org\/solr\/8_7_0\/solr-core\/org\/apache\/solr\/handler\/component\/ResponseLogComponent.html\">ResponseLogComponent<\/a>\u00a0javadocs.<\/li>\n<li><code>PhrasesIdentificationComponent<\/code>, used to identify &amp; score &#8220;phrases&#8221; found in the input string, based on shingles in indexed fields, described in the\u00a0<a href=\"https:\/\/lucene.apache.org\/solr\/8_7_0\/solr-core\/org\/apache\/solr\/handler\/component\/PhrasesIdentificationComponent.html\">PhrasesIdentificationComponent<\/a>\u00a0javadocs.<\/li>\n<\/ul>\n<\/div>\n<\/section>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>After the\u00a0&lt;query&gt;\u00a0section of\u00a0solrconfig.xml, request handlers and search components are configured.A\u00a0request handler\u00a0processes requests coming to Solr. These might be query requests or index update requests. You will likely need several of these defined, depending on how you want Solr to handle the various requests you will make.A\u00a0search component\u00a0is a feature of search, such as highlighting or faceting. The search component is defined in\u00a0solrconfig.xml\u00a0separate from the request handlers, and then registered with a request handler as needed.These are often referred to as &#8220;requestHandler&#8221; and &#8220;searchComponent&#8221;, which is how they are defined in\u00a0solrconfig.xml. Request Handlers Every request handler is defined with a name and a class. The name of the request handler is referenced with the request to Solr, typically as a path. For example, if Solr is installed at\u00a0http:\/\/localhost:8983\/solr\/\u00a0and you have a collection named &#8220;gettingstarted&#8221;, you can make a request that looks like this: http:\/\/localhost:8983\/solr\/gettingstarted\/select?q=solr This query will be processed by the request handler with the name\u00a0\/select. We\u2019ve only used the &#8220;q&#8221; parameter here, which includes our query term, a simple keyword of &#8220;solr&#8221;. If the request handler has more parameters defined, those will be used with any query we send to this request handler unless they are over-ridden by the client (or user) in the query itself. If you have another request handler defined, you would send your request with that name. For example,\u00a0\/update\u00a0is a request handler that handles index updates (i.e., sending new documents to the index). By default,\u00a0\/select\u00a0is a request handler that handles query requests. Request handlers can also process requests for nested paths of their names, for example, a request using\u00a0\/myhandler\/extrapath\u00a0may be processed by a request handler registered with the name\u00a0\/myhandler. If a request handler is explicitly defined by the name\u00a0\/myhandler\/extrapath, that would take precedence over the nested path. This assumes you are using the request handler classes included with Solr; if you create your own request handler, you should make sure it includes the ability to handle nested paths if you want to use them with your custom request handler. It is also possible to configure defaults for request handlers with a section called\u00a0initParams. These defaults can be used when you want to have common properties that will be used by each separate handler. For example, if you intend to create several request handlers that will all request the same list of fields in the response, you can configure an\u00a0initParams\u00a0section with your list of fields. For more information about\u00a0initParams, see the section\u00a0InitParams in SolrConfig. SearchHandlers The primary request handler defined with Solr by default is the &#8220;SearchHandler&#8221;, which handles search queries. The request handler is defined, and then a list of defaults for the handler are defined with a\u00a0defaults\u00a0list. For example, in the default\u00a0solrconfig.xml, the first request handler defined looks like this: &lt;requestHandler name=&#8221;\/select&#8221; class=&#8221;solr.SearchHandler&#8221;&gt; &lt;lst name=&#8221;defaults&#8221;&gt; &lt;str name=&#8221;echoParams&#8221;&gt;explicit&lt;\/str&gt; &lt;int name=&#8221;rows&#8221;&gt;10&lt;\/int&gt; &lt;\/lst&gt; &lt;\/requestHandler&gt; This example defines the\u00a0rows\u00a0parameter, which defines how many search results to return, to &#8220;10&#8221;. The\u00a0echoParams\u00a0parameter defines that the parameters defined in the query should be returned when debug information is returned. Note also that the way the defaults are defined in the list varies if the parameter is a string, an integer, or another type. All of the parameters described in the section\u00a0Searching\u00a0can be defined as defaults for any of the SearchHandlers. Besides\u00a0defaults, there are other options for the SearchHandler, which are: appends: This allows definition of parameters that are added to the user query. These might be\u00a0filter queries, or other query rules that should be added to each query. There is no mechanism in Solr to allow a client to override these additions, so you should be absolutely sure you always want these parameters applied to queries. &lt;lst name=&#8221;appends&#8221;&gt; &lt;str name=&#8221;fq&#8221;&gt;inStock:true&lt;\/str&gt; &lt;\/lst&gt; In this example, the filter query &#8220;inStock:true&#8221; will always be added to every query. &nbsp; invariants: This allows definition of parameters that cannot be overridden by a client. The values defined in an\u00a0invariants\u00a0section will always be used regardless of the values specified by the user, by the client, in\u00a0defaults\u00a0or in\u00a0appends. &lt;lst name=&#8221;invariants&#8221;&gt; &lt;str name=&#8221;facet.field&#8221;&gt;cat&lt;\/str&gt; &lt;str name=&#8221;facet.field&#8221;&gt;manu_exact&lt;\/str&gt; &lt;str name=&#8221;facet.query&#8221;&gt;price:[* TO 500]&lt;\/str&gt; &lt;str name=&#8221;facet.query&#8221;&gt;price:[500 TO *]&lt;\/str&gt; &lt;\/lst&gt; In this example, facet fields have been defined which limits the facets that will be returned by Solr. If the client requests facets, the facets defined with a configuration like this are the only facets they will see. &nbsp; The final section of a request handler definition is\u00a0components, which defines a list of search components that can be used with a request handler. They are only registered with the request handler. How to define a search component is discussed further on in the section on\u00a0Search Components\u00a0below. The\u00a0components\u00a0element can only be used with a request handler that is a SearchHandler. The\u00a0solrconfig.xml\u00a0file includes many other examples of SearchHandlers that can be used or modified as needed. UpdateRequestHandlers The UpdateRequestHandlers are request handlers which process updates to the index. In this guide, we\u2019ve covered these handlers in detail in the section\u00a0Uploading Data with Index Handlers. ShardHandlers It is possible to configure a request handler to search across shards of a cluster, used with distributed search. More information about distributed search and how to configure the shardHandler is in the section\u00a0Distributed Search with Index Sharding. Implicit Request Handlers Solr includes many out-of-the-box request handlers that are not configured in\u00a0solrconfig.xml, and so are referred to as &#8220;implicit&#8221; &#8211; see\u00a0Implicit RequestHandlers. Search Components Search components define the logic that is used by the SearchHandler to perform queries for users. Default Components There are several default search components that work with all SearchHandlers without any additional configuration. If no components are defined (with the exception of\u00a0first-components\u00a0and\u00a0last-components\u00a0&#8211; see below), these are executed by default, in the following order: Component Name Class Name More Information query solr.QueryComponent Described in the section\u00a0Query Syntax and Parsing. facet solr.FacetComponent Described in the section\u00a0Faceting. mlt solr.MoreLikeThisComponent Described in the section\u00a0MoreLikeThis. highlight solr.HighlightComponent Described in the section\u00a0Highlighting. stats solr.StatsComponent Described in the section\u00a0The Stats Component. debug solr.DebugComponent Described in the section on\u00a0Common Query Parameters. expand solr.ExpandComponent Described in the section\u00a0Collapse and Expand Results. If you register a new search [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1862,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[95,7,13],"class_list":["post-1859","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-solr","tag-request-handlers","tag-solr","tag-solrcloud"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide - Aeologic Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide - Aeologic Blog\" \/>\n<meta property=\"og:description\" content=\"After the\u00a0&lt;query&gt;\u00a0section of\u00a0solrconfig.xml, request handlers and search components are configured.A\u00a0request handler\u00a0processes requests coming to Solr. These might be query requests or index update requests. You will likely need several of these defined, depending on how you want Solr to handle the various requests you will make.A\u00a0search component\u00a0is a feature of search, such as highlighting or faceting. The search component is defined in\u00a0solrconfig.xml\u00a0separate from the request handlers, and then registered with a request handler as needed.These are often referred to as &#8220;requestHandler&#8221; and &#8220;searchComponent&#8221;, which is how they are defined in\u00a0solrconfig.xml. Request Handlers Every request handler is defined with a name and a class. The name of the request handler is referenced with the request to Solr, typically as a path. For example, if Solr is installed at\u00a0http:\/\/localhost:8983\/solr\/\u00a0and you have a collection named &#8220;gettingstarted&#8221;, you can make a request that looks like this: http:\/\/localhost:8983\/solr\/gettingstarted\/select?q=solr This query will be processed by the request handler with the name\u00a0\/select. We\u2019ve only used the &#8220;q&#8221; parameter here, which includes our query term, a simple keyword of &#8220;solr&#8221;. If the request handler has more parameters defined, those will be used with any query we send to this request handler unless they are over-ridden by the client (or user) in the query itself. If you have another request handler defined, you would send your request with that name. For example,\u00a0\/update\u00a0is a request handler that handles index updates (i.e., sending new documents to the index). By default,\u00a0\/select\u00a0is a request handler that handles query requests. Request handlers can also process requests for nested paths of their names, for example, a request using\u00a0\/myhandler\/extrapath\u00a0may be processed by a request handler registered with the name\u00a0\/myhandler. If a request handler is explicitly defined by the name\u00a0\/myhandler\/extrapath, that would take precedence over the nested path. This assumes you are using the request handler classes included with Solr; if you create your own request handler, you should make sure it includes the ability to handle nested paths if you want to use them with your custom request handler. It is also possible to configure defaults for request handlers with a section called\u00a0initParams. These defaults can be used when you want to have common properties that will be used by each separate handler. For example, if you intend to create several request handlers that will all request the same list of fields in the response, you can configure an\u00a0initParams\u00a0section with your list of fields. For more information about\u00a0initParams, see the section\u00a0InitParams in SolrConfig. SearchHandlers The primary request handler defined with Solr by default is the &#8220;SearchHandler&#8221;, which handles search queries. The request handler is defined, and then a list of defaults for the handler are defined with a\u00a0defaults\u00a0list. For example, in the default\u00a0solrconfig.xml, the first request handler defined looks like this: &lt;requestHandler name=&quot;\/select&quot; class=&quot;solr.SearchHandler&quot;&gt; &lt;lst name=&quot;defaults&quot;&gt; &lt;str name=&quot;echoParams&quot;&gt;explicit&lt;\/str&gt; &lt;int name=&quot;rows&quot;&gt;10&lt;\/int&gt; &lt;\/lst&gt; &lt;\/requestHandler&gt; This example defines the\u00a0rows\u00a0parameter, which defines how many search results to return, to &#8220;10&#8221;. The\u00a0echoParams\u00a0parameter defines that the parameters defined in the query should be returned when debug information is returned. Note also that the way the defaults are defined in the list varies if the parameter is a string, an integer, or another type. All of the parameters described in the section\u00a0Searching\u00a0can be defined as defaults for any of the SearchHandlers. Besides\u00a0defaults, there are other options for the SearchHandler, which are: appends: This allows definition of parameters that are added to the user query. These might be\u00a0filter queries, or other query rules that should be added to each query. There is no mechanism in Solr to allow a client to override these additions, so you should be absolutely sure you always want these parameters applied to queries. &lt;lst name=&quot;appends&quot;&gt; &lt;str name=&quot;fq&quot;&gt;inStock:true&lt;\/str&gt; &lt;\/lst&gt; In this example, the filter query &#8220;inStock:true&#8221; will always be added to every query. &nbsp; invariants: This allows definition of parameters that cannot be overridden by a client. The values defined in an\u00a0invariants\u00a0section will always be used regardless of the values specified by the user, by the client, in\u00a0defaults\u00a0or in\u00a0appends. &lt;lst name=&quot;invariants&quot;&gt; &lt;str name=&quot;facet.field&quot;&gt;cat&lt;\/str&gt; &lt;str name=&quot;facet.field&quot;&gt;manu_exact&lt;\/str&gt; &lt;str name=&quot;facet.query&quot;&gt;price:[* TO 500]&lt;\/str&gt; &lt;str name=&quot;facet.query&quot;&gt;price:[500 TO *]&lt;\/str&gt; &lt;\/lst&gt; In this example, facet fields have been defined which limits the facets that will be returned by Solr. If the client requests facets, the facets defined with a configuration like this are the only facets they will see. &nbsp; The final section of a request handler definition is\u00a0components, which defines a list of search components that can be used with a request handler. They are only registered with the request handler. How to define a search component is discussed further on in the section on\u00a0Search Components\u00a0below. The\u00a0components\u00a0element can only be used with a request handler that is a SearchHandler. The\u00a0solrconfig.xml\u00a0file includes many other examples of SearchHandlers that can be used or modified as needed. UpdateRequestHandlers The UpdateRequestHandlers are request handlers which process updates to the index. In this guide, we\u2019ve covered these handlers in detail in the section\u00a0Uploading Data with Index Handlers. ShardHandlers It is possible to configure a request handler to search across shards of a cluster, used with distributed search. More information about distributed search and how to configure the shardHandler is in the section\u00a0Distributed Search with Index Sharding. Implicit Request Handlers Solr includes many out-of-the-box request handlers that are not configured in\u00a0solrconfig.xml, and so are referred to as &#8220;implicit&#8221; &#8211; see\u00a0Implicit RequestHandlers. Search Components Search components define the logic that is used by the SearchHandler to perform queries for users. Default Components There are several default search components that work with all SearchHandlers without any additional configuration. If no components are defined (with the exception of\u00a0first-components\u00a0and\u00a0last-components\u00a0&#8211; see below), these are executed by default, in the following order: Component Name Class Name More Information query solr.QueryComponent Described in the section\u00a0Query Syntax and Parsing. facet solr.FacetComponent Described in the section\u00a0Faceting. mlt solr.MoreLikeThisComponent Described in the section\u00a0MoreLikeThis. highlight solr.HighlightComponent Described in the section\u00a0Highlighting. stats solr.StatsComponent Described in the section\u00a0The Stats Component. debug solr.DebugComponent Described in the section on\u00a0Common Query Parameters. expand solr.ExpandComponent Described in the section\u00a0Collapse and Expand Results. If you register a new search [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"Aeologic Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AeoLogicTech\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-31T05:54:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2021\/05\/RequestHandlers-and-SearchComponents-in-SolrConfig.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"1037\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Manoj Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@aeologictech\" \/>\n<meta name=\"twitter:site\" content=\"@aeologictech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manoj Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/\"},\"author\":{\"name\":\"Manoj Kumar\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/13549984ba8e5f441cc733ed20d7daa4\"},\"headline\":\"RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide\",\"datePublished\":\"2021-05-31T05:54:54+00:00\",\"dateModified\":\"2021-05-31T05:54:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/\"},\"wordCount\":1216,\"publisher\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2021\/05\/RequestHandlers-and-SearchComponents-in-SolrConfig.png\",\"keywords\":[\"request handlers\",\"solr\",\"solrcloud\"],\"articleSection\":[\"Solr\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/\",\"url\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/\",\"name\":\"RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide - Aeologic Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2021\/05\/RequestHandlers-and-SearchComponents-in-SolrConfig.png\",\"datePublished\":\"2021-05-31T05:54:54+00:00\",\"dateModified\":\"2021-05-31T05:54:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#primaryimage\",\"url\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2021\/05\/RequestHandlers-and-SearchComponents-in-SolrConfig.png\",\"contentUrl\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2021\/05\/RequestHandlers-and-SearchComponents-in-SolrConfig.png\",\"width\":1800,\"height\":1037},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.aeologic.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#website\",\"url\":\"https:\/\/www.aeologic.com\/blog\/\",\"name\":\"Aeologic Blog\",\"description\":\"Aeologic\",\"publisher\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.aeologic.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#organization\",\"name\":\"AeoLogic Technologies\",\"url\":\"https:\/\/www.aeologic.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2022\/05\/new-logo-aeo.jpg\",\"contentUrl\":\"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2022\/05\/new-logo-aeo.jpg\",\"width\":385,\"height\":162,\"caption\":\"AeoLogic Technologies\"},\"image\":{\"@id\":\"https:\/\/www.aeologic.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/AeoLogicTech\/\",\"https:\/\/x.com\/aeologictech\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/13549984ba8e5f441cc733ed20d7daa4\",\"name\":\"Manoj Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/24ce77602da5eb5715d74a95733f6c7548e2af73f5a493f9bc0bf55f611d025e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/24ce77602da5eb5715d74a95733f6c7548e2af73f5a493f9bc0bf55f611d025e?s=96&d=mm&r=g\",\"caption\":\"Manoj Kumar\"},\"description\":\"Manoj Kumar is a seasoned Digital Marketing Manager and passionate Tech Blogger with deep expertise in SEO, AI trends, and emerging digital technologies. He writes about innovative solutions that drive growth and transformation across industry. Featured on - YOURSTORY | TECHSLING | ELEARNINGINDUSTRY | DATASCIENCECENTRAL | TIMESOFINDIA | MEDIUM | DATAFLOQ\",\"sameAs\":[\"https:\/\/www.aeologic.com\/\",\"https:\/\/www.linkedin.com\/in\/manoj-kumar-rajput\/\"],\"url\":\"https:\/\/www.aeologic.com\/blog\/author\/manoj\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide - Aeologic Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/","og_locale":"en_US","og_type":"article","og_title":"RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide - Aeologic Blog","og_description":"After the\u00a0&lt;query&gt;\u00a0section of\u00a0solrconfig.xml, request handlers and search components are configured.A\u00a0request handler\u00a0processes requests coming to Solr. These might be query requests or index update requests. You will likely need several of these defined, depending on how you want Solr to handle the various requests you will make.A\u00a0search component\u00a0is a feature of search, such as highlighting or faceting. The search component is defined in\u00a0solrconfig.xml\u00a0separate from the request handlers, and then registered with a request handler as needed.These are often referred to as &#8220;requestHandler&#8221; and &#8220;searchComponent&#8221;, which is how they are defined in\u00a0solrconfig.xml. Request Handlers Every request handler is defined with a name and a class. The name of the request handler is referenced with the request to Solr, typically as a path. For example, if Solr is installed at\u00a0http:\/\/localhost:8983\/solr\/\u00a0and you have a collection named &#8220;gettingstarted&#8221;, you can make a request that looks like this: http:\/\/localhost:8983\/solr\/gettingstarted\/select?q=solr This query will be processed by the request handler with the name\u00a0\/select. We\u2019ve only used the &#8220;q&#8221; parameter here, which includes our query term, a simple keyword of &#8220;solr&#8221;. If the request handler has more parameters defined, those will be used with any query we send to this request handler unless they are over-ridden by the client (or user) in the query itself. If you have another request handler defined, you would send your request with that name. For example,\u00a0\/update\u00a0is a request handler that handles index updates (i.e., sending new documents to the index). By default,\u00a0\/select\u00a0is a request handler that handles query requests. Request handlers can also process requests for nested paths of their names, for example, a request using\u00a0\/myhandler\/extrapath\u00a0may be processed by a request handler registered with the name\u00a0\/myhandler. If a request handler is explicitly defined by the name\u00a0\/myhandler\/extrapath, that would take precedence over the nested path. This assumes you are using the request handler classes included with Solr; if you create your own request handler, you should make sure it includes the ability to handle nested paths if you want to use them with your custom request handler. It is also possible to configure defaults for request handlers with a section called\u00a0initParams. These defaults can be used when you want to have common properties that will be used by each separate handler. For example, if you intend to create several request handlers that will all request the same list of fields in the response, you can configure an\u00a0initParams\u00a0section with your list of fields. For more information about\u00a0initParams, see the section\u00a0InitParams in SolrConfig. SearchHandlers The primary request handler defined with Solr by default is the &#8220;SearchHandler&#8221;, which handles search queries. The request handler is defined, and then a list of defaults for the handler are defined with a\u00a0defaults\u00a0list. For example, in the default\u00a0solrconfig.xml, the first request handler defined looks like this: &lt;requestHandler name=\"\/select\" class=\"solr.SearchHandler\"&gt; &lt;lst name=\"defaults\"&gt; &lt;str name=\"echoParams\"&gt;explicit&lt;\/str&gt; &lt;int name=\"rows\"&gt;10&lt;\/int&gt; &lt;\/lst&gt; &lt;\/requestHandler&gt; This example defines the\u00a0rows\u00a0parameter, which defines how many search results to return, to &#8220;10&#8221;. The\u00a0echoParams\u00a0parameter defines that the parameters defined in the query should be returned when debug information is returned. Note also that the way the defaults are defined in the list varies if the parameter is a string, an integer, or another type. All of the parameters described in the section\u00a0Searching\u00a0can be defined as defaults for any of the SearchHandlers. Besides\u00a0defaults, there are other options for the SearchHandler, which are: appends: This allows definition of parameters that are added to the user query. These might be\u00a0filter queries, or other query rules that should be added to each query. There is no mechanism in Solr to allow a client to override these additions, so you should be absolutely sure you always want these parameters applied to queries. &lt;lst name=\"appends\"&gt; &lt;str name=\"fq\"&gt;inStock:true&lt;\/str&gt; &lt;\/lst&gt; In this example, the filter query &#8220;inStock:true&#8221; will always be added to every query. &nbsp; invariants: This allows definition of parameters that cannot be overridden by a client. The values defined in an\u00a0invariants\u00a0section will always be used regardless of the values specified by the user, by the client, in\u00a0defaults\u00a0or in\u00a0appends. &lt;lst name=\"invariants\"&gt; &lt;str name=\"facet.field\"&gt;cat&lt;\/str&gt; &lt;str name=\"facet.field\"&gt;manu_exact&lt;\/str&gt; &lt;str name=\"facet.query\"&gt;price:[* TO 500]&lt;\/str&gt; &lt;str name=\"facet.query\"&gt;price:[500 TO *]&lt;\/str&gt; &lt;\/lst&gt; In this example, facet fields have been defined which limits the facets that will be returned by Solr. If the client requests facets, the facets defined with a configuration like this are the only facets they will see. &nbsp; The final section of a request handler definition is\u00a0components, which defines a list of search components that can be used with a request handler. They are only registered with the request handler. How to define a search component is discussed further on in the section on\u00a0Search Components\u00a0below. The\u00a0components\u00a0element can only be used with a request handler that is a SearchHandler. The\u00a0solrconfig.xml\u00a0file includes many other examples of SearchHandlers that can be used or modified as needed. UpdateRequestHandlers The UpdateRequestHandlers are request handlers which process updates to the index. In this guide, we\u2019ve covered these handlers in detail in the section\u00a0Uploading Data with Index Handlers. ShardHandlers It is possible to configure a request handler to search across shards of a cluster, used with distributed search. More information about distributed search and how to configure the shardHandler is in the section\u00a0Distributed Search with Index Sharding. Implicit Request Handlers Solr includes many out-of-the-box request handlers that are not configured in\u00a0solrconfig.xml, and so are referred to as &#8220;implicit&#8221; &#8211; see\u00a0Implicit RequestHandlers. Search Components Search components define the logic that is used by the SearchHandler to perform queries for users. Default Components There are several default search components that work with all SearchHandlers without any additional configuration. If no components are defined (with the exception of\u00a0first-components\u00a0and\u00a0last-components\u00a0&#8211; see below), these are executed by default, in the following order: Component Name Class Name More Information query solr.QueryComponent Described in the section\u00a0Query Syntax and Parsing. facet solr.FacetComponent Described in the section\u00a0Faceting. mlt solr.MoreLikeThisComponent Described in the section\u00a0MoreLikeThis. highlight solr.HighlightComponent Described in the section\u00a0Highlighting. stats solr.StatsComponent Described in the section\u00a0The Stats Component. debug solr.DebugComponent Described in the section on\u00a0Common Query Parameters. expand solr.ExpandComponent Described in the section\u00a0Collapse and Expand Results. If you register a new search [&hellip;]","og_url":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/","og_site_name":"Aeologic Blog","article_publisher":"https:\/\/www.facebook.com\/AeoLogicTech\/","article_published_time":"2021-05-31T05:54:54+00:00","og_image":[{"width":1800,"height":1037,"url":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2021\/05\/RequestHandlers-and-SearchComponents-in-SolrConfig.png","type":"image\/png"}],"author":"Manoj Kumar","twitter_card":"summary_large_image","twitter_creator":"@aeologictech","twitter_site":"@aeologictech","twitter_misc":{"Written by":"Manoj Kumar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#article","isPartOf":{"@id":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/"},"author":{"name":"Manoj Kumar","@id":"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/13549984ba8e5f441cc733ed20d7daa4"},"headline":"RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide","datePublished":"2021-05-31T05:54:54+00:00","dateModified":"2021-05-31T05:54:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/"},"wordCount":1216,"publisher":{"@id":"https:\/\/www.aeologic.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2021\/05\/RequestHandlers-and-SearchComponents-in-SolrConfig.png","keywords":["request handlers","solr","solrcloud"],"articleSection":["Solr"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/","url":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/","name":"RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide - Aeologic Blog","isPartOf":{"@id":"https:\/\/www.aeologic.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2021\/05\/RequestHandlers-and-SearchComponents-in-SolrConfig.png","datePublished":"2021-05-31T05:54:54+00:00","dateModified":"2021-05-31T05:54:54+00:00","breadcrumb":{"@id":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#primaryimage","url":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2021\/05\/RequestHandlers-and-SearchComponents-in-SolrConfig.png","contentUrl":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2021\/05\/RequestHandlers-and-SearchComponents-in-SolrConfig.png","width":1800,"height":1037},{"@type":"BreadcrumbList","@id":"https:\/\/www.aeologic.com\/blog\/requesthandlers-and-searchcomponents-in-solrconfig-ultimate-solr-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.aeologic.com\/blog\/"},{"@type":"ListItem","position":2,"name":"RequestHandlers and SearchComponents in SolrConfig \u2013 Ultimate Solr Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.aeologic.com\/blog\/#website","url":"https:\/\/www.aeologic.com\/blog\/","name":"Aeologic Blog","description":"Aeologic","publisher":{"@id":"https:\/\/www.aeologic.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.aeologic.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.aeologic.com\/blog\/#organization","name":"AeoLogic Technologies","url":"https:\/\/www.aeologic.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aeologic.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2022\/05\/new-logo-aeo.jpg","contentUrl":"https:\/\/www.aeologic.com\/blog\/wp-content\/uploads\/2022\/05\/new-logo-aeo.jpg","width":385,"height":162,"caption":"AeoLogic Technologies"},"image":{"@id":"https:\/\/www.aeologic.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/AeoLogicTech\/","https:\/\/x.com\/aeologictech"]},{"@type":"Person","@id":"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/13549984ba8e5f441cc733ed20d7daa4","name":"Manoj Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aeologic.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/24ce77602da5eb5715d74a95733f6c7548e2af73f5a493f9bc0bf55f611d025e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/24ce77602da5eb5715d74a95733f6c7548e2af73f5a493f9bc0bf55f611d025e?s=96&d=mm&r=g","caption":"Manoj Kumar"},"description":"Manoj Kumar is a seasoned Digital Marketing Manager and passionate Tech Blogger with deep expertise in SEO, AI trends, and emerging digital technologies. He writes about innovative solutions that drive growth and transformation across industry. Featured on - YOURSTORY | TECHSLING | ELEARNINGINDUSTRY | DATASCIENCECENTRAL | TIMESOFINDIA | MEDIUM | DATAFLOQ","sameAs":["https:\/\/www.aeologic.com\/","https:\/\/www.linkedin.com\/in\/manoj-kumar-rajput\/"],"url":"https:\/\/www.aeologic.com\/blog\/author\/manoj\/"}]}},"_links":{"self":[{"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/posts\/1859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/comments?post=1859"}],"version-history":[{"count":1,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/posts\/1859\/revisions"}],"predecessor-version":[{"id":15078,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/posts\/1859\/revisions\/15078"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/media\/1862"}],"wp:attachment":[{"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/media?parent=1859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/categories?post=1859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aeologic.com\/blog\/wp-json\/wp\/v2\/tags?post=1859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}