-
Improvement
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
None
When upgrading to solr 9, we found that negative boosts don't work. The instrument core uses this uses this to move search results further down the list in the case that the instrument is a "Family" - e.g. "trumpet family" vs "trumpet".
We tried to apply a boost to all non-matching items, e.g. -type:Family^5 but this has the result of setting the score of this item to 0 and omitting it from the search results, so we can't use this technique.
We tried to use a boost bq between 0 and 1 (e.g. 0.1 or 0.01), but the solr documentation indicates that this is additive, so a score is always going to be (query score + boost score). To do a multiplicative boost (where you can factor a score by a value), you must use theĀ {{
{!boost}}} query parser or the boost parameter to edismax. We don't want to switch directly to edismax at the moment.
We were able to simulate a low boost by sorting by abs(sub(1,termfreq(type,'Family'))) and then by score (this is 0 if 'Family' is in the type field, 1 otherwise). But this makes the results still look weird. E.g. "baritone" has the word "trumpet" in its description, so it has some score (we weight on the description field), but the result "trumpet family".
At the moment, the we just removed this boost flag and the results still look OK, but we should see if there is a way of moving the search results for Family types a bit further.