2013-01-11 19 views
0

我已將solrconfig.xml配置爲使用Suggester組件,如http://wiki.apache.org/solr/Suggester中所建議的。如何在solr中爲建議者配置solrconfig.xml?

<searchComponent class="solr.SpellCheckComponent" name="suggest"> 
    <lst name="spellchecker"> 
     <str name="name">suggest</str> 
     <str name="classname">org.apache.solr.spelling.suggest.Suggester</str> 
     <str name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookup</str> 
     <str name="field">name</str> 
     <!-- the indexed field to derive suggestions from --> 
     <float name="threshold">0.005</float> 
     <str name="buildOnCommit">true</str> 
     <!-- 
     <str name="sourceLocation">american-english</str> 
--> 
    </lst> 
    </searchComponent> 

    <requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/suggest"> 
    <lst name="defaults"> 
     <str name="spellcheck">true</str> 
     <str name="spellcheck.dictionary">suggest</str> 
     <str name="spellcheck.onlyMorePopular">true</str> 
     <str name="spellcheck.count">5</str> 
     <str name="spellcheck.collate">true</str> 
    </lst> 
    <arr name="components"> 
     <str>suggest</str> 
    </arr> 
    </requestHandler> 

然而,當我在瀏覽器網址我沒有得到任何建議瀏覽。

http://localhost:8080/solr/collection1/suggest?q=ava&fq=type%3ACategory&wt=xml 

<response> 
<lst name="responseHeader"> 
<int name="status"> 
0 
</int> 
<int name="QTime"> 
0 
</int> 
</lst> 
<lst name="spellcheck"> 
<lst name="suggestions"/> 
</lst> 
</response> 

即使我刪除fq過濾器,我沒有得到的建議。

請幫忙。

感謝

回答

1

我不知道,你可以嘗試添加拼寫檢查=上

http://localhost:8080/solr/collection1/suggest?q=ava&spellcheck=on&fq=type%3ACategory&wt=xml