Hello,
I am trying to learn solr config api and having problem creating suggester.
Any pointers will be appriciated

suggester has been setup with

curl -X POST -H 'Content-type:application/json' --data-binary '{
 "add-searchcomponent": {
  "class": "solr.SuggestComponent",
  "name": "titleSuggester",
  "lookupImpl": "FuzzyLookupFactory",
  "dictionaryImpl": "DocumentDictionaryFactory",
  "field": "title_facet",
  "suggestAnalyzerFieldType": "string",
  "buildOnStartup": true
 }
}' http://localhost:8983/solr/jn_core/config


and corresponding handler


echo
echo "setting up suggest handler"
curl -X POST -H 'Content-type:application/json' --data-binary '{
 "update-requesthandler": {
  "name": "/suggest",
  "startup": "lazy",
  "class": "solr.SearchHandler",
  "defaults": {
   "suggest": true,
   "suggest.count": 10
  },
  "components": ["titleSuggester"]
 }
}' http://localhost:8983/solr/jn_core/config


it seems to be configured


http://localhost:8983/solr/jn_core/config/searchComponent?componentName=titleSuggester

{
  "responseHeader":{
    "status":0,
    "QTime":1},
  "config":{"searchComponent":{"titleSuggester":{
        "class":"solr.SuggestComponent",
        "name":"titleSuggester",
        "lookupImpl":"FuzzyLookupFactory",
        "dictionaryImpl":"DocumentDictionaryFactory",
        "field":"title_facet",
        "suggestAnalyzerFieldType":"string",
        "buildOnStartup":true}}}}

but solr returns "No suggester named titleSuggester was configured"
http://localhost:8983/solr/jn_core/suggest?suggest=true&suggest.build=true&suggest.q=elec&suggest.dictionary=titleSuggester

  "responseHeader":{

    "status":400,
    "QTime":0},
  "error":{
    "metadata":[
      "error-class","org.apache.solr.common.SolrException",
      "root-error-class","org.apache.solr.common.SolrException"],
    "msg":"No suggester named titleSuggester was configured",
    "code":400}}

Reply via email to