Negative boost query (bq) with edismax for lower scores with Solr 8

classic Classic list List threaded Threaded
1 message Options
CO
Reply | Threaded
Open this post in threaded view
|

Negative boost query (bq) with edismax for lower scores with Solr 8

CO
I find that the edismax boost query implementation is not quite logical. It does not allow selectively decreasing the relevancy score anymore.

E.g. bq=color:red^2 can be added to increase the score of matching documents.

But how can I decrease the score for documents with color:red? Before Solr 8 it could be done with bq=color:red^-1. But negative boosts are not supported by Lucene anymore (LUCENE-7996).

Note that bq=color:red^0.1 does not lead to a lower score since other values will be treated like boost 0. If all potential values are known this would work: bq=color:red^0.1 color:green^1 color:blue^1. But what if not?

I tried bq=color:*^1 -color:red^0.1. This sort of works but the boost seems to be ignored. When I write bq=color:*^1 -color:red^0.1 -color:green^0.5 the score is the same for documents with color:red and color:green.

Any suggestion how I can decrease the score for documents with color:red a bit and a bit more for those with color:green after upgrading to Solr 8?