我添加了两个组件(DirectSolrSpellChecker,WordBreakSolr),如下所示:
{
"add-searchcomponent":{
"spellchecker":[{
"name":"directsolr",
"field":"spellCorrectField",
"classname":"solr.DirectSolrSpellChecker",
"maxEdits":2,
"accuracy":0.5,
"comparatorClass":"freq"
},
{
"name":"wbsolr",
"field":"spellCorrectField",
"classname":"solr.WordBreakSolrSpellChecker",
"combineWords":true,
"breakWords":true,
"maxChanges":1,
"minBreakLength":2,
"comparatorClass":"freq"
}],
"name":"spellerDSSCWBSSC",
"class":"solr.SpellCheckComponent"
}
}
我的处理程序如下:
{
"update-requesthandler":{
"name":"/spell",
"class":"solr.SearchHandler",
"defaults":{
"spellcheck":true,
"spellcheck.count":10,
"spellcheck.dictionary":["directsolr","wbsolr"],
"spellcheck.build":true,
"spellcheck.collate":true,
"spellcheck.onlyMorePopular":false,
"spellcheck.extendedResults":true,
"spellcheck.collateExtendedResults":true,
"spellcheck.maxCollationTries":10,
"spellcheck.collateParam.q.op":"AND"
},
"last-components":[
"spellerDSSCWBSSC"
]
}
}
当我得到结果时,我将DiretSolr和WordBreakSolr的结果合并在一起。有一种方法可以将DirectSolrSpellChecker的结果发送到WordBreakSolrSpellChecker,因为我想更正拼写,然后将其提供给WordBreakSolrSpellChecker。