Sthita
Sthita

Reputation: 1782

Understanding solr(8.x) default searchHandler

This is newbie question, but trying understand solr search handler with defaults enabled.

As per my understanding df is used for Default search field, what will happen/how does it work if remove this part?

My scenario currently: I am pushing/adding all fields data (e.g title, department, etc.) to text. So when I search free text it can be searchable (using edismax) and it works as expected. But when tomorrow new fields come, I mean suppose it will be title, department , somefield, then I have to reindex all data again. Then it will be searchable. How can I achieve that? Can I have multiple fields in df?

example : <str name="df">title, department, etc,etc </str> like this ?

<requestHandler name="/select" class="solr.SearchHandler">
<!-- default values for query parameters can be specified, these
     will be overridden by parameters in the request
-->
  <lst name="defaults">
  <str name="echoParams">explicit</str>
  <int name="rows">10</int>
  <!-- Default search field -->
  <str name="df">text</str>
</lst>

Upvotes: 1

Views: 76

Answers (1)

MatsLindh
MatsLindh

Reputation: 52902

Since you're using edismax, you can provide the qf argument with multiple fields instead - and weights between them. Another option is to have one common field, i.e. something like text and a copyField instruction that copies everything (source set to *) to text (dest set to text), then search against that field.

Using either won't require a reindex, since the content will either be copied from all documents indexed as they're being indexed, or the search will consider more fields (with qf).

You can set the default value for the qf in the same was a you've shown above in the config file under defaults.

Upvotes: 1

Related Questions