【问题标题】:Solr qf field ordering impact on searchSolr qf 字段排序对搜索的影响
【发布时间】:2015-04-28 10:51:30
【问题描述】:

我的问题: 在进行搜索时,“内容”的优先级高于我的其他字段。

Solr 搜索请求处理程序:

  <requestHandler name="/select" class="solr.SearchHandler">
    <lst name="defaults">
      <str name="defType">edismax</str>
      <str name="echoParams">explicit</str>
      <int name="rows">10</int>
      <str name="df">text</str>
      <str name="q.alt">*:*</str>
      <str name="q.op">AND</str>
      <str name="qf">title^15.0 description^9.0 categoryNames^3.0 authorName^1.0 content^1.0</str>
      <str name="boost">scoreA</str>
    </lst>
    <lst name="appends">
      <str name="fq">private:false</str>
      <str name="fq">deleted:false</str>
      <str name="fq">draft:false</str>
    </lst>
  </requestHandler>

这是我的 Solr 回复中的评分:

100% 0.003303376 ((content:world | title:world^15.0 | categoryNames:world^3.0 | description:world^9.0 | authorName:world) (content:war | title:war^15.0 | categoryNames:war^3.0 | description:war^9.0 | authorName:war))~2,FileFloatSource(field=scoreA,keyField=id,defVal=0.0,dataDir=/opt/solr/current/data/resource/)
0.95% 0.005617031 sum of the following:
0.27% 0.0016038928 (MATCH) max of:
0.27% 0.0016038928 content:world
0.68% 0.004013138 (MATCH) max of:
0.68% 0.004013138 content:war
99.05% 0.5881     float(scoreA{type=ext_resource_float,properties=indexed,stored,omitTermFreqAndPositions})=0.5881

得分明细:http://explain.solr.pl/explains/73itib4r

据我所知,“内容”是重中之重。不知道为什么会这样,因为我在我的 Solr qf 字段中是最后一个。

我需要“内容”是最低的影响者和最高的标题。

【问题讨论】:

    标签: solr lucene


    【解决方案1】:

    您的 parsedQuery (content:world | title:world^15.0 | categoryNames:world^3.0 | description:world^9.0 | authorName:world) (content:war | title:war^15.0 | categoryNames:war^3.0 | description:war^9.0 | authorName:war)) 中的顺序并不意味着第一个字段是先验字段。唯一重要的是每个字段的权重。

    为了证明这一点,您可以看到您的内容字段仅占总分的 0.27%,这是您想要的行为:

    0.27% 0.0016038928 (MATCH) max of: 0.27% 0.0016038928 content:world

    【讨论】:

      猜你喜欢
      • 2011-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-24
      • 2011-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多