user2868104
user2868104

Reputation: 297

qf in solr is not giving a specefied field any boost

As a simplified example. I have two fields: title and keywords. I am using edismax with the following parameter

qf: title + keywords^2

Previously, it was working fine. I have about 15M records indexed in solr. All records have non-empty title. Most records HAD non-empty keywords.

But recently, we decided to remove keywords for most records. As a result, we currently only have 1 record (out of 15M records) that has non-empty keywords.

Unfortunately, as a result of that, the keywords^2 boost specified in qf does not seem to work any more.

For that record, we have title, say, "good store", and keywords, say, "pants clothing". Now, if I search for 'good store pants', the solr matching score is exactly the same regardless of whether I use qf: title or qf: title keywords^2.5. (Again, I think it worked before when most records have non-empty keywords since the solr matching scores are different for the above comparison.)

Upvotes: 3

Views: 479

Answers (1)

user2868104
user2868104

Reputation: 297

Answering my own question. Since there is only one record that has non-empty keywords. Based on the IDF formula used by solr, the base value is smaller than 1. There fore, boosting it by ^2 does not help at all. So, I think the "solution" is to add more records with non-empty keywords. Of course, this is not a real solution.

See following for output from debugQuery.

  0.84748024 = weight(keywords:good in 4161) [], result of:
    0.84748024 = score(doc=4161,freq=1.0 = termFreq=1.0
    ), product of:
      3.0 = boost
      0.2876821 = idf(docFreq=1, docCount=1)
      0.9819638 = tfNorm, computed from:
        1.0 = termFreq=1.0
        1.2 = parameter k1
        0.75 = parameter b
        5.0 = avgFieldLength
        5.2244897 = fieldLength

Upvotes: 1

Related Questions