2017-09-13 91 views
0

我是solr的新用户,并且尝试为我的网站添加新建议功能。 我已经使用AnalyzingInfixLookupFactory在solrconfig.The suggetion建议添加建议功能工作正常,但结果在我的网站就要像Solr Suggest AnalyzingInfixLookupFactory

nestle <b>MILO</b> Activ 

,但它应该像

"nestle MILO Activ" without the "<b>" "</b>" 

如何我可以在solr上设置这个吗?

这里是我的solrconfig

<searchComponent name="suggest" class="solr.SuggestComponent"> 
    <lst name="suggester"> 
     <str name="name">mySuggest</str> 
     <str name="lookupImpl">AnalyzingInfixLookupFactory</str> 
     <str name="dictionaryImpl">DocumentDictionaryFactory</str> 
     <str name="field">goodsName</str> 
     <str name="weightField">popularity</str> 
     <str name="suggestAnalyzerFieldType">text_en</str> 
     <str name="buildOnStartup">true</str> 
    </lst> 
    </searchComponent> 


    <requestHandler name="/suggest" class="solr.SearchHandler" 
        > 
    <lst name="defaults"> 
     <str name="suggest.dictionary">mySuggest</str> 
     <str name="suggest">true</str> 
     <str name="suggest.count">10</str> 
    </lst> 
    <arr name="components"> 
     <str>suggest</str> 
    </arr> 
    </requestHandler> 

回答

1

由于you're using AnalyzingInfixLookupFactory,它有一个自定义的配置参数,使您可以关闭高亮显示:

亮点:高亮提示条款。默认值是true。

因此,为了避免突出自己的建议,在您的配置设置highlight为false应该足够:

<str name="highlight">false</str>