我将我的solr更新为4.9.1(我想实现solr Suggester
)并更新其solrconfig.xml
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">mySuggester</str>
<str name="lookupImpl">FuzzyLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">cat</str>
<str name="weightField">price</str>
<str name="suggestAnalyzerFieldType">string</str>
<str name="buildOnStartup">false</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
这是我的sunspot.yml
development:
solr:
hostname: localhost
port: 8982
log_level: INFO
path: /solr/development
但访问http://localhost:8982/solr/development/suggest?suggest=true&suggest.build=true&suggest.dictionary=mySuggester&wt=json&suggest.q=ac
时没有结果值:
{"responseHeader": {
"status":0,"QTime":38
},
"command":"build",
"suggest":{
"mySuggester": {
"ac":{
"numFound":0,
"suggestions":[]
}
}
}
}
我错过了重要的事情吗?
我跟着the documentation for the Solr Suggester component。
如何显示我的solr的建议结果?
谢谢:)