为什么Solr没有按最大相似系数排名?

时间:2014-08-18 18:00:11

标签: java solr lucene

我已经创建了一个自定义相似度类,我希望Solr按coord()排名。在我的结果中,具有此调试查询结果的文档

 0.0 = (MATCH) weight(text:现在 in 0) [MyNewSimilarityClass], result of:
      0.0 = score(doc=0,freq=1.0 = termFreq=1.0
         ), product of:
        0.0 = queryWeight, product of:
          0.0 = idf(docFreq=103081, maxDocs=4060152)
          0.0 = queryNorm
        0.0 = fieldWeight in 0, product of:
          0.0 = tf(freq=1.0), with freq of:
            1.0 = termFreq=1.0
          0.0 = idf(docFreq=103081, maxDocs=4060152)
          1.0 = fieldNorm(doc=0)
  1.43425728E8 = coord(2/167)

排名高于具有此调试查询结果的文档

 0.0 = (MATCH) weight(text:中国 in 5) [MyNewSimilarityClass], result of:
      0.0 = score(doc=5,freq=1.0 = termFreq=1.0),
        product of:
        0.0 = queryWeight, product of:
          0.0 = idf(docFreq=39366, maxDocs=4060152)
          0.0 = queryNorm
        0.0 = fieldWeight in 5, product of:
          0.0 = tf(freq=1.0), with freq of:
            1.0 = termFreq=1.0
          0.0 = idf(docFreq=39366, maxDocs=4060152)
          1.0 = fieldNorm(doc=5)
  8.9641069E8 = coord(5/167)

除了coord()因素之外,两者都是平等的,为什么它不会将排名较高的coord()因子排在第一位?

1 个答案:

答案 0 :(得分:2)

由于您的其他评分因子为零,因此两个文档的总分为零/ 0(这是首先显示的值)。评分(主要)是每个术语的产物(而不是添加剂)。

请参阅Lucene's Practical and Conceptual Scoring Formula