Solr:如果指定了sort参数,文档是否得分?

时间:2013-12-08 23:18:13

标签: performance solr

我们有大量的功能过滤查询被推入主查询(q参数)。我担心这些额外的部分会得到不必要的评分。但是我们确实指定了一种排序,并且分数不包括在排序中。所以我的问题是搜索是否得分,因为最终它没有按分数排序?

1 个答案:

答案 0 :(得分:0)

基于“说明”日志,即使在字段上指定排序参数,它看起来也会得分。

这是我在没有排序参数的情况下观察到的“解释”日志,(结果按分数排序):

http://localhost:8983/solr/logmill/select?q=text_en%3A%22not+found%22&wt=xml&indent=true&debugQuery=true


<lst name="explain">
<str name="localhost/281/info/1373983754934/5ba362b4e8a6fce36ba650cf8e946771">
2.2986562 = (MATCH) weight(text_en:found in 131) [DefaultSimilarity], result of: 2.2986562 = fieldWeight in 131, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 4.5973125 = idf(docFreq=3, maxDocs=146) 0.5 = fieldNorm(doc=131)
</str>
<str name="localhost/258/info/1373983752897/8a2e39f484dedff91bd11b94f442bd8a">
1.7239921 = (MATCH) weight(text_en:found in 126) [DefaultSimilarity], result of: 1.7239921 = fieldWeight in 126, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 4.5973125 = idf(docFreq=3, maxDocs=146) 0.375 = fieldNorm(doc=126)
</str>
<str name="localhost/294/info/1373983755710/8a2e39f484dedff91bd11b94f442bd8a">
1.7239921 = (MATCH) weight(text_en:found in 136) [DefaultSimilarity], result of: 1.7239921 = fieldWeight in 136, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 4.5973125 = idf(docFreq=3, maxDocs=146) 0.375 = fieldNorm(doc=136)
</str>
</lst>
</lst>

以下是使用sort param查询的“explain”日志,(结果按timestamp_tdt字段排序):

http://localhost:8983/solr/logmill/select?q=text_en%3A%22not+found%22&wt=xml&indent=true&debugQuery=true&sort=timestamp_tdt%20asc

<lst name="explain">
<str name="localhost/258/info/1373983752897/8a2e39f484dedff91bd11b94f442bd8a">
1.7239921 = (MATCH) weight(text_en:found in 126) [DefaultSimilarity], result of: 1.7239921 = fieldWeight in 126, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 4.5973125 = idf(docFreq=3, maxDocs=146) 0.375 = fieldNorm(doc=126)
</str>
<str name="localhost/281/info/1373983754934/5ba362b4e8a6fce36ba650cf8e946771">
2.2986562 = (MATCH) weight(text_en:found in 131) [DefaultSimilarity], result of: 2.2986562 = fieldWeight in 131, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 4.5973125 = idf(docFreq=3, maxDocs=146) 0.5 = fieldNorm(doc=131)
</str>
<str name="localhost/294/info/1373983755710/8a2e39f484dedff91bd11b94f442bd8a">
1.7239921 = (MATCH) weight(text_en:found in 136) [DefaultSimilarity], result of: 1.7239921 = fieldWeight in 136, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 4.5973125 = idf(docFreq=3, maxDocs=146) 0.375 = fieldNorm(doc=136)
</str>
</lst>
</lst>

即使我在解释日志中指定&amp; sort = timestamp_tdt%20asc,我也看到它正在计算草皮和分数的乘积等。希望这有助于找到问题的答案。