我对solr 6.5.0的拼写检查组件有一个恼人的问题 . 如果我通过拼写检查请求处理程序/ spell运行查询,则查询按预期工作,我会得到错误单词的建议拼写 .
{
"responseHeader":{
"status":0,
"QTime":42},
"response":{"numFound":0,"start":0,"docs":[]
},
"spellcheck":{
"suggestions":{
"injary":{
"numFound":3,
"startOffset":0,
"endOffset":6,
"origFreq":0,
"suggestion":[{
"word":"injury",
"freq":121},
{
"word":"inward",
"freq":3},
{
"word":"injure",
"freq":1}]}},
"correctlySpelled":false,
"collations":{
"collation":{
"collationQuery":"injury",
"hits":121,
"misspellingsAndCorrections":[
"injary","injury"]},
"collation":{
"collationQuery":"inward",
"hits":3,
"misspellingsAndCorrections":[
"injary","inward"]},
"collation":{
"collationQuery":"injure",
"hits":1,
"misspellingsAndCorrections":[
"injary","injure"]}}}}
但是如果我通过标准请求处理程序/ select运行查询,我就得不到任何建议 .
{
"responseHeader":{
"status":0,
"QTime":0,
"params":{
"q":"injary",
"indent":"on",
"spellcheck":"on",
"wt":"json",
"_":"1492780436450"}},
"response":{"numFound":0,"start":0,"docs":[]
}}
任何帮助将不胜感激 .
我修改了 solrconfig.xml 以将两个请求处理程序放入行中,如下所示,其余的是默认值:
default
content
solr.DirectSolrSpellChecker
internal
0.5
2
1
5
4
0.01
.0001
default
on
true
10
5
5
true
true
10
5
json
spellcheck
explicit
10
_text_
json
true
5
true
5
spellcheck