Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change 
notification.

The "SolrRequestHandler" page has been changed by DavidSmiley:
http://wiki.apache.org/solr/SolrRequestHandler?action=diff&rev1=21&rev2=22

Comment:
handleSelect=true is no longer the default.

  Multiple handlers (including multiple instances of the same 
!SolrRequestHandler class with different configurations) can be specified in 
the [[SolrConfigXml|solrconfig.xml]]
  
  {{{
-   <requestHandler name="foo" default="true" 
class="my.package.CustomRequestHandler" />
+   <requestHandler name="/foo" class="my.package.CustomRequestHandler" />
-   <requestHandler name="bar" class="my.package.AnotherCustomRequestHandler">
      <!-- initialization args may optionally be defined here -->
       <lst name="defaults">
         <int name="rows">10</int>
@@ -19, +18 @@

       </lst>
    </requestHandler>
  
-   <requestHandler name="/baz" class="my.package.AnotherCustomRequestHandler">
    <requestHandler name="/update/my-pdf-reader" 
class="my.package.MyPdfHandler">
  }}}
  
  == Handler Resolution ==
  
- Clients access specific !SolrRequestHandlers either with the 
[[CoreQueryParameters|'qt' parameter]] on a request for the {{{/select/}}} url, 
or through the path registered in solrconfig.xml.  For the above example, 
running on localhost:8983/solr/, you could access:
+ Clients access specific !SolrRequestHandlers through the remaining URL path 
(starting with a '/') corresponding with a named request handler (also starting 
with a '/').  For the above example, running on localhost:8983/solr/, you could 
access:
  
  {{{
-   http://localhost:8983/solr/select/?qt=foo&;...
-   http://localhost:8983/solr/select/?qt=bar&;...
-   http://localhost:8983/solr/baz?...
+   http://localhost:8983/solr/foo?...
    http://localhost:8983/solr/update/my-pdf-reader?...
  }}}
  
- Solr selects a handler to process a request using the following steps...
+ === Old handleSelect=true Resolution (qt param) ===
  
+ The {{{<requestDispatcher>}}} element has a {{{handleSelect}}} attribute 
which defaults to false as of Solr 3.6. Before then it was true, and the 
example solrconfig.xml had it explicitly set to true as well.  When it is true, 
there is an additional dispatch rule that comes into place if the request uses 
"/select" but there is no request handler by that name.  Instead of it being an 
error, Solr uses the "qt" parameter to lookup the handler by name.  In limited 
cases, 'qt' may start with a leading '/' but that practice should be avoided.  
If there is no 'qt' parameter then the default handler is chosen.
-    1. look for a handler with a name matching the request (either the full 
path or the "qt")
-    1. look for a handler configured with {{{default="true"}}}
-    1. look for a handler configured with name="standard"
-    1. use an anonymous instance of 
[[http://lucene.apache.org/solr/api/org/apache/solr/handler/StandardRequestHandler.html|StandardRequestHandler]]
  
+ {{{
+   http://localhost:8983/solr/select?qt=mysearch&;...
+ }}}
+ 'qt' can be used to choose a request handler in other cases aside from a new 
HTTP request.  Two others are for the warming queries and also for the ping 
query, both configured in solrconfig.xml.  For these other cases, there is no 
restrictions on a leading '/'.  And in these cases, when 'qt' is not specified, 
the default handler is chosen.
  
+ '''The default handler''' is normally the handler named "/select".  However 
another specific handler can be anointed as such with a {{{default="true"}}} 
attribute on it, if desired.  "standard" was the old default name and will 
still work but it's legacy/deprecated.  If there is no default handler, then 
most/all cases in which a default one is chosen will instead trigger an error.
- Note! If your solrconfig.xml contains requestHandlers with the name= 
"/select", "/update", or "/admin" you will short circuit the standard request 
processing and use your own logic.  
- 
- Note! While the example schema has a requestHandler with the name "/dismax", 
if you want to use dismax you are better off using the {{{/select}}} 
requestHandler and select dismax via {{{defType=dismax}}}. 
- 
  
  == Content Streams ==
  

Reply via email to