Question

What's the best way to boost static values in Solr 3.6.2?

Each document has exactly one (KeywordTokenized) source value (information origin) and I want to express some are more important than others. Full content control is possible if it helps.

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

Unfortunately the additive boost query has virtually no effect. The parsed query looks like this (qux is stemmed to qu)

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

The debug queries for the top two results which doesn't significantly respect 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)

Interesting to note is that the first result has no queryWeight for source despite having a value in the source field. fieldNorm is also a bit different due to lemmatization

Was it helpful?

Solution

The issue is most likely due to queryNorm. See: http://lucene.472066.n3.nabble.com/QueryNorm-and-FieldNorm-td1992964.html

As long as you are not comparing results based on scores from different queries, the relevance ordering within a single search should be fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top