我希望我的搜索结果按照他们正在进行的分数排序,但分数计算不正确。这就是说,不一定,但不同于预期,我不知道为什么。我的目标是消除任何正在改变分数的东西。Solr:fieldNorm每个文档不同,没有文档提示
如果我执行的搜索匹配两个对象(其中ObjectA预计比ObjectB得分高),ObjectB将首先返回。
比方说,对于这个例子,我的查询是一个单词:“苹果”。
对象A的标题:“苹果是苹果”(2/3计算)
对象A的描述:“有在苹果,苹果苹果,现在苹果就所有的苹果都在苹果” (6/18条款)
ObjectB的标题:“苹果很棒”(1/3条款)
ObjectB的描述:“苹果房间里有苹果,现在苹果全都变坏了! (4/18条款)
标题栏没有增加(或者更确切地说,增加1),说明栏增加了0.8。我没有通过solrconfig.xml或通过查询指定文档增强。如果还有另一种方式来指定文档提示,那么我有可能会丢失文档。
分析explain
打印完成后,它看起来像对象A 是正确计算得分高于对象B,就像我想,除了一个区别:对象B的标题fieldNorm总是比对象A的高。
下面打印输出explain
。只要你知道:标题字段是mditem5_tns
和描述字段是mditem7_tns
:
ObjectB:
1.3327172 = (MATCH) sum of:
1.0352166 = (MATCH) max plus 0.1 times others of:
0.9766194 = (MATCH) weight(mditem5_tns:appl in 0), product of:
0.53929156 = queryWeight(mditem5_tns:appl), product of:
1.8109303 = idf(docFreq=3, maxDocs=9)
0.2977981 = queryNorm
1.8109303 = (MATCH) fieldWeight(mditem5_tns:appl in 0), product of:
1.0 = tf(termFreq(mditem5_tns:appl)=1)
1.8109303 = idf(docFreq=3, maxDocs=9)
1.0 = fieldNorm(field=mditem5_tns, doc=0)
0.58597165 = (MATCH) weight(mditem7_tns:appl^0.8 in 0), product of:
0.43143326 = queryWeight(mditem7_tns:appl^0.8), product of:
0.8 = boost
1.8109303 = idf(docFreq=3, maxDocs=9)
0.2977981 = queryNorm
1.3581977 = (MATCH) fieldWeight(mditem7_tns:appl in 0), product of:
2.0 = tf(termFreq(mditem7_tns:appl)=4)
1.8109303 = idf(docFreq=3, maxDocs=9)
0.375 = fieldNorm(field=mditem7_tns, doc=0)
0.2975006 = (MATCH) FunctionQuery(1000.0/(1.0*float(top(rord(lastmodified)))+1000.0)), product of:
0.999001 = 1000.0/(1.0*float(1)+1000.0)
1.0 = boost
0.2977981 = queryNorm
ObjectA:
1.2324848 = (MATCH) sum of:
0.93498427 = (MATCH) max plus 0.1 times others of:
0.8632177 = (MATCH) weight(mditem5_tns:appl in 0), product of:
0.53929156 = queryWeight(mditem5_tns:appl), product of:
1.8109303 = idf(docFreq=3, maxDocs=9)
0.2977981 = queryNorm
1.6006513 = (MATCH) fieldWeight(mditem5_tns:appl in 0), product of:
1.4142135 = tf(termFreq(mditem5_tns:appl)=2)
1.8109303 = idf(docFreq=3, maxDocs=9)
0.625 = fieldNorm(field=mditem5_tns, doc=0)
0.7176658 = (MATCH) weight(mditem7_tns:appl^0.8 in 0), product of:
0.43143326 = queryWeight(mditem7_tns:appl^0.8), product of:
0.8 = boost
1.8109303 = idf(docFreq=3, maxDocs=9)
0.2977981 = queryNorm
1.6634457 = (MATCH) fieldWeight(mditem7_tns:appl in 0), product of:
2.4494898 = tf(termFreq(mditem7_tns:appl)=6)
1.8109303 = idf(docFreq=3, maxDocs=9)
0.375 = fieldNorm(field=mditem7_tns, doc=0)
0.2975006 = (MATCH) FunctionQuery(1000.0/(1.0*float(top(rord(lastmodified)))+1000.0)), product of:
0.999001 = 1000.0/(1.0*float(1)+1000.0)
1.0 = boost
0.2977981 = queryNorm
您能否详细说明或者可能提供链接?为什么“stemmer”将我的领域扩大到它*不是*的地方?这似乎与直觉相反! :) – JMTyler 2010-06-23 19:49:11
除非你写的第一个“appl”应该是“apple”?如果“苹果”正在被分解成它的根源形式,那么刚刚研究过词干,那将是有道理的。所以 - 让我知道如果我有这个权利 - 你是说如果我改变所有引用“苹果”,只搜索“苹果”,我应该得到我想要的结果? – JMTyler 2010-06-23 20:05:39
我编辑了我的帖子,所以现在应该更清楚了。词干使用“appl”作为“苹果”和“苹果”的根形式。所以如果你停用词干,你应该得到你期望的结果。您还可以通过将术语添加到protwords.txt中来排除术语并更改schema.xml –
Jem
2010-06-23 20:56:22