0

I would like to add the following searchHandler to my solr core locally:

  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
    <str name="queryAnalyzerFieldType">spell_checking_text</str>
    <lst name="spellchecker">
      <str name="name">spellchecker</str>
      <str name="field">spellchecker</str>
      <str name="classname">solr.DirectSolrSpellChecker</str>
    </lst>
  </searchComponent>

Is there any way to do this through cURL?

Aizaz
  • 39
  • 7
  • Have you seen https://solr.apache.org/guide/solr/latest/configuration-guide/config-api.html#commands-for-handlers-and-components ? – MatsLindh Oct 19 '22 at 18:33

1 Answers1

1

If you want to add a searchComponent through cURL, here is an example:

curl -X POST -H 'Content-type:application/json' -d '{
  "add-searchcomponent": {
    "name": "spellcheck",
    "class": "solr.SpellCheckComponent",
    "spellchecker": { "name": "spellchecker" ,"field": "spellchecker", "classname":"solr.DirectSolrSpellChecker" }
  }
}' http://localhost:8983/solr/collection_name/config

Depending on the version of Solr you are using, here you can find the relative reference guide. This is for the latest Solr version.

Seasers
  • 466
  • 2
  • 7