We have been working on creating scoring profiles for our search. We need a way to "bury" or give "negative" boosts to some fields in case of types of scoring function "Magnitude", "Freshness", "Tags". We noticed that we cannot add a negative value for boost. Is there any other way to achieve this kind of behavior (burying results based the field) We cannot use $OrderBy because it takes precedence over the scoring profile.
Please advise. Thanks!Answer1:
you should only set positive boosting values, as described
[here]. There may be a few things you could do. The first thing I would try is to set the weight to 0 for the fields that you do not care about. In that case, they will simply not impact the relevance.
Another option: If you know that a field should not impact relevance you could simply make that field not 'searchable'. That said, this is a property of the index definition -- so you would need to create a different index for each combination of non-searchable fields.
Depending on your scenario, you could also make a field filterable, and filter based on that field. Something like $filer=Freshenss eq 'Really Fresh'. See <a href="https://docs.microsoft.com/en-us/azure/search/search-filters" rel="nofollow">this link</a> for more information on using filters.
thanks! -Luis CabreraAnswer2:
For "Magnitude", "Freshness", you can set the set the range start as higher value and range end as lower value. Would this be considered as negative impact?
Like this: <a href="https://i.stack.imgur.com/jDTSF.png" rel="nofollow"><img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/jDTSF.png" data-original="https://i.stack.imgur.com/jDTSF.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>Answer3:
I resolved that scenario by creating negative values (using an
INT field) for the field we wanted to bury. That gave us the negative boost we needed.
I used a similar technique for Date "Freshness" too, where we counted the days from some event and the higher the number the less fresh the date is and used a "magnitude" function for it.