我试图同时使用qf和bf字段,但我无法理解得分的结果。我可以知道分数是如何计算的吗?
以下是我所做的查询: http://localhost:8983/solr/core name / select?bf = likes ^ 0.8%20created_time ^ 0.8& debugQuery = on& defType = edismax& indent = on& q = Samsung& qf = description ^ 0.8& wt = json
我得分
"rawquerystring":"Samsung"
"querystring":"Samsung"
"parsedquery":"(+DisjunctionMaxQuery(((description:samsung)^0.8)) FunctionQuery(date(created_time))^0.8 FunctionQuery(int(likes))^0.8)/no_coord"
"parsedquery_toString":"+((description:samsung)^0.8) (date(created_time))^0.8 (int(likes))^0.8"
"explain":{
"23379598044_10154409629363045":"\n1.19288942E12 = sum of:\n 4.6113086 = weight(description:samsung in 61828) [SchemaSimilarity], result of:\n 4.6113086 = score(doc=61828,freq=1.0 = termFreq=1.0\n), product of:\n 0.8 = boost\n 4.2966447 = idf(docFreq=780, docCount=57329)\n 1.3415436 = tfNorm, computed from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.75 = parameter b\n 13.833522 = avgFieldLength\n 5.2244897 = fieldLength\n 1.19288942E12 = FunctionQuery(date(created_time)), product of:\n 1.49111177E12 = date(created_time)=2017-04-02T05:43:00Z\n 0.8 = boost\n 1.0 = queryNorm\n 22.4 = FunctionQuery(int(likes)), product of:\n 28.0 = int(likes)=28\n 0.8 = boost\n 1.0 = queryNorm\n",
答案 0 :(得分:0)
好的,让我们先解读它 - 首先要做的事情是将解释转化为更具可读性的东西,例如,将\n
替换为真正的回车符,如下所示:
1.19288942E12 = sum of:
4.6113086 = weight(description:samsung in 61828) [SchemaSimilarity], result of:
4.6113086 = score(doc=61828,freq=1.0 = termFreq=1.0), product of:
0.8 = boost
4.2966447 = idf(docFreq=780, docCount=57329)
1.3415436 = tfNorm, computed from:
1.0 = termFreq=1.0
1.2 = parameter k1
0.75 = parameter b
13.833522 = avgFieldLength
5.2244897 = fieldLength
1.19288942E12 = FunctionQuery(date(created_time)), product of:
1.49111177E12 = date(created_time)=2017-04-02T05:43:00Z
0.8 = boost
1.0 = queryNorm
22.4 = FunctionQuery(int(likes)), product of:
28.0 = int(likes)=28
0.8 = boost
1.0 = queryNorm
只是为了说清楚 - 此解释仅适用于结果集中包含id= 23379598044_10154409629363045
的文档。
让我们分解1.19288942E12
的总分。正如它所说 - 它是3部分的总和:
4.6113086 = weight(description:samsung in 61828)
- 此部分与您的查询本身密切相关。由于您的查询是q=Samsung
和qf=description^0.8
,这意味着如果文档将匹配到字段description
中 - 那么DisMax会将值提升0.8倍(这里是{{3的参考) }})。这就是解释说:4.6113086 ... is product of: 0.8 = boost, 4.2966447 = idf and 1.3415436 = tfNorm
。请注意,Solr中的默认评分模型< 6.0是qf param。1.19288942E12 = FunctionQuery(date(created_time))
- 此部分与bf=created_time^0.8
部分相关(为了解释,我排除了likes^0.8
- 基本上它将在最后一个要点中介绍)。 Solr(DisMax)在这里做了什么 - 它为此特定文档(2017-04-02T05:43:00Z)获取created_time
的值,然后将其转换为UNIX时间戳(1.49111177E12),然后将其乘以因子为0.8。你可能会注意到1.19288942E12是一个非常大的数字,如果你把它与初始的TF / IDF进行比较。通常它实际上是低效的,我建议使用像TF/IDF这样的标准化功能来实现这些目的。22.4 = FunctionQuery(int(likes))
- 此部分与bf=likes^0.8
相关。基本上Solr也会获取该特定文档(28)的字段值,并乘以系数0.8。这是我的小记:如果你知道这个字段的值的分布 - 这是非常好的 - 也许这在实践中是有用的。但有时候你永远不会知道你的分布,也值得你的领域标准化 - 例如应用一些scale
reciprocal。我不是坚持 - 只是一些建议:)希望它能为你提供更好的'解释'理解的一些提示:)