我正在使用Solr 6.3版本,我正在尝试实现自动建议器,其中我需要应用上下文过滤器。我使用了'AnalyzingInfixLookupFactory'用于lookupImplementation,'DocumentDictionaryFactory'用于dictionaryImpl,并在文档类型'Product'上应用了过滤器。但是,它对我不起作用。
以下是相同的示例代码:
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">mySuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">productName</str>
<str name="contextField">documentType</str>
<str name="weightField"></str>
<str name="suggestAnalyzerFieldType">lowercase</str>
<int name="maxEdits">2</int>
<str name="buildOnStartup">false</str>
</lst>
</searchComponent>
请求处理程序:
<requestHandler name="/suggest" class="solr.SearchHandler"
startup="lazy" >
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
查询:
/suggest&df=productName&cfq=Product&suggest=true&suggest.build=true&suggest.dictionary=mySuggester&suggest.q=cap
答案 0 :(得分:2)
该参数名为suggest.cfq
(与建议模块的其他参数一样),而不仅仅是普通cfq
。