I added the search component and the request handler in the solrconfig.xml file, but I get an error saying
"No suggester named default was configured" when I type
../../suggest?suggest.q=A&wt=json&suggest.build=true&indent=true&debugQuery=true
in the browser
Suppose your search component is:
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">mySuggester</str>
...
</lst>
First way:
You must add "dictionary" parameter to your request handler default parameters as follows:
<requestHandler name="/suggest" class="solr.SearchHandler">
<lst name="defaults">
<str name="suggest.dictionary">mySuggester</str>
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
Second way:
If you haven't specified "dictionary" parameter in your request handler default parameters, you must add it to URL.
For example:
<requestHandler name="/suggest" class="solr.SearchHandler">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
Then you can use following url:
../../suggest?suggest.dictionary=mySuggester&q=A&wt=json&suggest.build=true&indent=true&debugQuery=true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With