0
我使用Solr的5.2,我想用IndexBasedSpellChecker我searchHandler裏面,這是我IndexBasedSpellChecker的SearchComponent:如何在solr中配置IndexBasedSpellChecker?
<searchComponent class="solr.SpellCheckComponent" name="spellcheck">
<str name="queryAnalyzerFieldType">text_en_general</str>
<lst name="spellchecker">
<str name="name">default</str>
<!--specify a field to use for the suggestions-->
<str name="field">body-en</str>
<str name="classname">solr.IndexBasedSpellChecker</str>
<!-- <str name="distanceMeasure">internal</str> -->
<!--The accuracy setting defines the threshold for a valid suggestion-->
<!-- <float name="accuracy">0.05</float> -->
<!-- maxEdits defines the number of changes to the term to allow-->
<int name="maxEdits">2</int>
<!--defines the minimum number of characters the terms should share-->
<int name="minPrefix">1</int>
<!--defines the maximum number of possible matches to review before returning results-->
<int name="maxInspections">5</int>
<!--defines how many characters must be in the query before suggestions are provided-->
<int name="minQueryLength">4</int>
<!-- sets the maximum threshold for the number of documents a term must appear in before being considered as a suggestion-->
<float name="maxQueryFrequency">0.01</float>
<!--sets the minimum number of documents a term must appear in-->
<float name="thresholdTokenFrequency">.01</float>
這裏我的問題是,當我想使用準確性,它給了我這個錯誤
Caused by: org.apache.solr.common.SolrException: java.lang.Float cannot be cast to java.lang.String
當我評論這個設置,它會給我一個其他錯誤使用distanceMeasure:
org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Error loading class 'internal'
,當我COMENT他們兩個,我無法從我的拼寫檢查得到的結果,當我查詢一個短語,它只是拼寫檢查的短語的第一個字,是什麼我應該做?