【问题标题】:SOLR more-like-this query parser returns no resultsSOLR 更像这个查询解析器不返回任何结果
【发布时间】:2017-06-19 16:36:11
【问题描述】:

我正在尝试让更像这样的查询解析器在我的测试系统上运行。测试系统安装了SOLR cloud 6.5.0。使用以下配置启用 MLT 处理程序:

<requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
    <lst name="defaults">
        <str name="mlt.qf">search_text_st</str>
        <str name="mlt.fl">search_text_st</str>
        <int name="mlt.minwl">4</int>
        <int name="mlt.maxwl">18</int>
    </lst>
</requestHandler>

当我使用处理程序查询类似于特定文档的文档时,我得到了预期的结果。例如:

http://localhost:8983/solr/MyCloud/mlt?q=id:123

以上查询将返回结果:

"response":{"numFound":361,"start":0,"maxScore":113.24594,"docs":[...]}

但是,当我尝试使用带有 {!mlt qf=search_text_st fl=search_text_st minwl=4 maxwl=18}123 的 MLTQParser 进行等效查询时,我没有得到任何结果:

http://localhost:8983/solr/MyCloud/select?q=%7B!mlt+qf%3Dsearch_text_st+fl%3Dsearch_text_st+minwl%3D4+maxwl%3D18%7D123

响应如下所示:

"response":{"numFound":0,"start":0,"maxScore":0.0,"docs":[]}

到目前为止,我尚未启用或配置 MLTQParser,但它似乎已启用,因为在使用不存在的文档 ID 时出现错误。

知道为什么这不起作用吗?

【问题讨论】:

    标签: solr solrcloud morelikethis


    【解决方案1】:

    我最终弄清楚了为什么会失败。 search_text_st 字段是使用 copyField 创建的。 Cloud MLT Query Parser 使用实时获取处理程序来检索要为关键字挖掘的字段。由于实时获取处理程序的实现方式,它不会返回使用copyField 填充的字段的数据。 (见https://issues.apache.org/jira/browse/SOLR-3743

    更改配置以使用源字段使其工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-22
      • 2022-10-13
      • 2015-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-19
      相关资源
      最近更新 更多