SOLR结果排名

时间:2016-06-21 08:23:03

标签: solr ranking

使用6.0.1 SOLR。  有一个类型声明:

 <fieldType name="customy_icu" class="solr.TextField" positionIncrementGap="100">
         <analyzer type="index">
            <tokenizer class="solr.ICUTokenizerFactory"/>
            <filter class="solr.LengthFilterFactory" min="1" max="100"/>
            <filter class="solr.NGramTokenizerFactory" minGramSize="2" maxGramSize="20"/>
            <filter class="solr.LowerCaseFilterFactory"/>
         </analyzer>
         <analyzer type="query">
            <tokenizer class="solr.ICUTokenizerFactory"/>
            <filter class="solr.LengthFilterFactory" min="1" max="100"/>
            <filter class="solr.LowerCaseFilterFactory"/>
         </analyzer>
      </fieldType>

customy_icu用于从右到左存储希伯来语(单词正在读/写)的文本数据。

当查询是“מיפנים”时 我得到的结果是错误的顺序,product_3351比产品product_3407更高(更相关),但反之亦然。 这是debug:

 <str name="product_3351">
2.711071 = sum of:
  2.711071 = max of:
    0.12766865 = weight(meta_keyword:"מי פנים" in 882) [ClassicSimilarity], result of:
      0.12766865 = score(doc=882,freq=1.0), product of:
        0.05998979 = queryWeight, product of:
          8.5126915 = idf(), sum of:
            4.7235003 = idf(docFreq=21, docCount=910)
            3.7891912 = idf(docFreq=55, docCount=910)
          0.0070471005 = queryNorm
        2.1281729 = fieldWeight in 882, product of:
          1.0 = tf(freq=1.0), with freq of:
            1.0 = phraseFreq=1.0
          8.5126915 = idf(), sum of:
            4.7235003 = idf(docFreq=21, docCount=910)
            3.7891912 = idf(docFreq=55, docCount=910)
          0.25 = fieldNorm(doc=882)
    2.711071 = weight(name:"מי פנים" in 882) [ClassicSimilarity], result of:
      2.711071 = score(doc=882,freq=1.0), product of:
        0.6178363 = queryWeight, product of:
          9.99 = boost
          8.776017 = idf(), sum of:
            4.8417873 = idf(docFreq=22, docCount=1071)
            3.93423 = idf(docFreq=56, docCount=1071)
          0.0070471005 = queryNorm
        4.3880086 = fieldWeight in 882, product of:
          1.0 = tf(freq=1.0), with freq of:
            1.0 = phraseFreq=1.0
          8.776017 = idf(), sum of:
            4.8417873 = idf(docFreq=22, docCount=1071)
            3.93423 = idf(docFreq=56, docCount=1071)
          0.5 = fieldNorm(doc=882)
</str>

  <str name="product_3407">
2.711071 = sum of:
  2.711071 = max of:
    2.711071 = weight(name:"מי פנים" in 919) [ClassicSimilarity], result of:
      2.711071 = score(doc=919,freq=1.0), product of:
        0.6178363 = queryWeight, product of:
          9.99 = boost
          8.776017 = idf(), sum of:
            4.8417873 = idf(docFreq=22, docCount=1071)
            3.93423 = idf(docFreq=56, docCount=1071)
          0.0070471005 = queryNorm
        4.3880086 = fieldWeight in 919, product of:
          1.0 = tf(freq=1.0), with freq of:
            1.0 = phraseFreq=1.0
          8.776017 = idf(), sum of:
            4.8417873 = idf(docFreq=22, docCount=1071)
            3.93423 = idf(docFreq=56, docCount=1071)
          0.5 = fieldNorm(doc=919)
</str>

产品3351具有名称字段值: סאבלייםסופטמיפנים 并且产品3407具有名称字段值:  מיפייםמיסלרים

http://screencast.com/t/2iBwLQqu

如何在结果列表中提升3407产品?

非常感谢!

2 个答案:

答案 0 :(得分:1)

如果您要将特定查询提升到结果集的顶部,与其自己的分数无关,请使用Query Elevation Component

没有自动提升#34;出现在文档的前面#34;但是有几种方法可以解决它。有关几种可能的解决方案,请参阅How to boost scores for early matches

&#34;相关性&#34;这是一个流利的术语,您必须在标准规则之外实现您认为适合您的应用程序的那种评分。您已包含的debugQuery显示默认情况下文档的相关性评分相同。

答案 1 :(得分:0)

您可以使用elevate.xml文件将特定文档设置为特定serachterm的结果集中的顶部。

示例:

<elevate>
<query text ="מי פנים">
<doc id="your_product_ID" />
</query>