SOLR建议带上下文过滤,如何更改算法?

时间:2018-11-27 09:25:49

标签: solr lucidworks

我目前正在使用自动完成功能/建议功能。由于应用程序的正常运行,我不得不使用 Context Filtering 功能,并且一切正常。

但是,我对算法和获得的结果有疑问。是否可以根据输入的字母顺序从键入的单词中显示建议的结果?

solrconfig.xml:

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

  <searchComponent name="suggest" class="solr.SuggestComponent">
      <lst name="suggester">
            <str name="name">mySuggester</str>
            <str name="lookupImpl">BlendedInfixLookupFactory</str>
            <str name="dictionaryImpl">DocumentDictionaryFactory</str>
            <str name="field">title_suggest</str>
            <str name="buildOnStartup">false</str>
            <str name="contextField">suggestionsfilter</str>
            <str name="suggestAnalyzerFieldType">text_general</str>            
      </lst>
  </searchComponent>

我知道,目前只有AnalysisInfixLookupFactory和BlendedInfixLookupFactory支持上下文过滤的solr提示程序,但是也许有人更改了配置并收到了我想要的结果,例如:

{
    "responseHeader": {
        "status": 0,
        "QTime": 1
    },
    "suggest": {
        "iiifSuggester": {
            "te": {
                "numFound": 1,
                "suggestions": [
                    {
                        "term": "test",
                        "weight": 0,
                        "payload": ""
                    }]}}}
}

但是实际上,我收到了以下内容:

{
    "responseHeader": {
        "status": 0,
        "QTime": 1
    },
    "suggest": {
        "iiifSuggester": {
            "te": {
                "numFound": 1,
                "suggestions": [
                    {
                        "term": "Suggest test result",
                        "weight": 0,
                        "payload": ""
                    }]}}}
}

非常感谢您的答复

亲切的问候, Wojciech

0 个答案:

没有答案