The anatomy of a Solr request
Request handlers
Request handlers are the entry points for essentially all requests to Solr. Their job is to receive a request, perform some function, and return a response to the client.
http://localhost:8983/solr/collection1/select/ http://localhost:8983/solr/collection1/update/ http://localhost:8983/solr/collection1/replication/ http://localhost:8983/solr/collection1/private/search/
Search components
Search components are configurable processing steps that occur within the lifetime of a search handler. Search components allow a search handler to chain together reusable pieces of functionality that can be executed with a single search request.Search components are configured in solrconfig.xml
Out of all the search components in the search handler, the query component is the most important, as it’s responsible for initially running the query and making the results available in the response (and for other search components to make use of afterward). The query component makes use of a query parser to interpret the incoming query from the request to the search handler.
Query parsers
Query parsers are used to interpret a search syntax into a Lucene query for finding a desired set of documents.
------------------------------------------------------------------------------------------------------------------------------------
Working with query parsers
When executing a search, QueryComponent handles the primary user query (the q parameter) by passing its value along to a query parser. As mentioned in lathest section, LuceneQParserPlugin is the default query parser in Solr.
Specifying a query parser
The default query parser type to be used for the QueryComponent can be modified using the defType parameter on the search request:
/select?defType=edismax&q=... /select?defType=term&q=... /select?q={!edismax}hello world /select?q={!term}hello /select?q={!edismax}hello world OR {!lucene}title:"my title"
Local params
Local params provide the ability to localize request parameters to a specific context.Typically you will pass request parameters to Solr on the URL, but sometimes you may only want some parameters to be applied to certain parts of the query. Within the context of a query, local params allow you to pass request parameters only to the specific query parser that you want to consider them, as opposed to making all request parameters global.
LOCAL PARAMS SYNTAX {!param1=value1 param2=value2 ... paramN=valueN}
/select?q=hello world&defType=edismax&qf=title^10 text&q.op=AND || /select?q={!defType=edismax qf="title^10 text" q.op=AND}hello world
The real difference between these two queries is that, in the first example, all of the request parameters are global.
PARAMETER DEREFERENCING /select?q={!edismax v=$userQuery}&userQuery="hello world"----------------------------------------------------------------------------------------------------------------------------------