2014-03-13 71 views
1

在Solr 3.6.2中提升静态值的最佳方法是什么?Solr多重提升查询

每个文件都有恰好一个(KeywordTokenized)source值(信息来源),我想表达一些比其他更重要。如果有帮助,全面的内容控制是可能的。

http://localhost:8080/solr/index/select?fl=source,score 
    &defType=edismax 
    &qf=title^4 
    &q=qux 
    &bq=source:foo^10 
    &bq=source:bar^14 

不幸的是,添加剂升压查询几乎没有影响。解析的查询看起来像这样(qux被朵朵屈)

+DisjunctionMaxQuery(((title:qux qu)^4.0))) source:foo^10.0 source:bar^14.0 

调试查询的前两名结果不显著尊重bq=source:foo^10

5.366351 = (MATCH) sum of: 5.366351 = (MATCH) sum of: 2.067319 = (MATCH) weight(title:qux in 4472), product of: 0.5513683 = queryWeight(title:qux), product of: 7.4988675 = idf(docFreq=35, maxDocs=23918) 0.073526874 = queryNorm 3.7494338 = (MATCH) fieldWeight(title:qux in 4472), product of: 1.0 = tf(termFreq(title:qux)=1) 7.4988675 = idf(docFreq=35, maxDocs=23918) 0.5 = fieldNorm(field=title, doc=4472) 3.299032 = (MATCH) weight(title:qu in 4472), product of: 0.69651634 = queryWeight(title:qu), product of: 9.472949 = idf(docFreq=4, maxDocs=23918) 0.073526874 = queryNorm 4.7364745 = (MATCH) fieldWeight(title:qu in 4472), product of: 1.0 = tf(termFreq(title:qu)=1) 9.472949 = idf(docFreq=4, maxDocs=23918) 0.5 = fieldNorm(field=title, doc=4472) 

5.281746 = (MATCH) sum of: 4.134638 = (MATCH) sum of: 4.134638 = (MATCH) weight(title:qux in 4402), product of: 0.5513683 = queryWeight(title:qux), product of: 7.4988675 = idf(docFreq=35, maxDocs=23918) 0.073526874 = queryNorm 7.4988675 = (MATCH) fieldWeight(title:qux in 4402), product of: 1.0 = tf(termFreq(title:qux)=1) 7.4988675 = idf(docFreq=35, maxDocs=23918) 1.0 = fieldNorm(field=title, doc=4402) 1.147108 = (MATCH) weight(source:foo^10.0 in 4402), product of: 0.45919293 = queryWeight(source:foo^10.0), product of: 10.0 = boost 2.4980958 = idf(docFreq=5346, maxDocs=23918) 0.018381719 = queryNorm 2.4980958 = (MATCH) fieldWeight(source:foo in 4402), product of: 1.0 = tf(termFreq(source:foo)=1) 2.4980958 = idf(docFreq=5346, maxDocs=23918) 1.0 = fieldNorm(field=source, doc=4402) 

而有趣的是,第一个结果具有queryWeight对于source尽管在source字段中具有值。 fieldNorm也有点不同,因为lemmatization

+0

第一个文档中'source'字段的值是什么?即id为4472的那个 – arun

+0

@arun值是'news',即一个与'bq'不匹配的值 –

+0

然后没有'queryWeight'作为'source'是有意义的,对吗?我猜你的qn是为什么'4472'的排名高于'4402'。 – arun

回答

1

这个问题很可能是由于queryNorm。请参阅: http://lucene.472066.n3.nabble.com/QueryNorm-and-FieldNorm-td1992964.html

只要您不比较基于不同查询得分的结果,单个搜索内的相关排序应该没问题。

+0

很有可能,更重要的是,似乎排名较高的结果有* no * queryWeight作为'source'字段。任何想法如何继续排除故障? –