我很难让Solr的“建议组件”与权重表达式一起使用。我试图匹配文档中示例的格式(请参阅下面的schema.xml和solrconfig.xml中的相关代码),但是当我从此字典中请求建议时未找到任何结果,并且没有日志记录错误或异常。我遗漏了一些东西还是参数不正确?
模式:
<field name="weight_one" type="pint" indexed="true" stored="true"/>
<field name="weight_two" type="pint" indexed="true" stored="true"/>
solrconfig:
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">SuggesterX</str>
<str name="dictionaryImpl">DocumentExpressionDictionaryFactory</str>
<str name="lookupImpl">FuzzyLookupFactory</str>
<str name="field">product_name</str>
<str name="weightExpression">(weight_one + weight_two)</str>
<str name="sortField">weight_one</str>
<str name="sortField">weight_two</str>
<str name="suggestAnalyzerFieldType">text_suggest</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">5</str>
<str name="suggest.dictionary">SuggesterX</str>
<!-- <str name="spellcheck.onlyMorePopular">true</str> -->
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>