Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between /select & /query handlers in solr

Tags:

solr

I want to know what is exact difference between /select & /query handlers in solr.

For /select handler, query is formed like.

/solr/collection/select?q=lalit&wt=json

which gives less results. enter image description here

But for /query, its /solr/collection/uery?q=lalit&wt=json

which gives much more results.

enter image description here

like image 624
Finn Avatar asked Aug 19 '14 11:08

Finn


1 Answers

The answer to this depends on the contents of your solrconfig.xml, as that is the configuration file where the different requestHandlers are defined. If you search that file for <requestHandler name="/select" class="solr.SearchHandler"> and <requestHandler name="/query" class="solr.SearchHandler">, you should be able to find what the difference is.

There is no different handling of those two internally in Solr, and their behaviour are always configured in solrconfig.xml. The default configuration in solrconfig.xml from the example/solr directory does this by setting a value for df (the default search field) to text (meaning that different fields are searched depending on which end point you point your search to).

You can configure your own definitions, such as /queryfoo, /bar etc. with different presets if you have a need in the future, although most settings are usually supplied by the client.

like image 63
MatsLindh Avatar answered Nov 05 '22 17:11

MatsLindh