0

I am still new to Solr. I am trying to find a place where I can put default query parameters.

I know I can set default query parameters in places such as <requestHandler name="/select" class="solr.SearchHandler"> , <requestHandler name="/query" class="solr.SearchHandler"> , and <requestHandler name="/browse" class="solr.SearchHandler">.

But what I really want is to set default query parameters for all the above three (or more) sections.

Example default parameters:

<str name="defType">edismax</str> <str name="qf"> id^2.5 name^2 </str>

Where should I place the above lines in `solrconfig.xml'

user2868104
  • 297
  • 2
  • 14

1 Answers1

2

In the latest Solr, you would use initParams section for that. The examples shipped with Solr demonstrate it.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27
  • do you know how to do this using the new Solr API (version 6.0 or higher)? – ypriverol May 10 '18 at 12:44
  • [Config API](https://lucene.apache.org/solr/guide/6_6/config-api.html) allows you to manipulate *initParams*. Or you can use *useParams* and [Request Parameters API](https://lucene.apache.org/solr/guide/6_6/request-parameters-api.html). The difference is kind of push (override) vs. pull (declare the dependency). – Alexandre Rafalovitch May 10 '18 at 14:21
  • Do you have an example working because I can't find a single example about that? – ypriverol May 10 '18 at 14:31
  • films example [demonstrates](https://github.com/apache/lucene-solr/blob/releases/lucene-solr/6.6.3/solr/example/films/README.txt#L65) Request Parameters API. – Alexandre Rafalovitch May 10 '18 at 14:49
  • I was checking the example of the film and it looks that only updating the facets in the config. – ypriverol May 10 '18 at 15:38