How to deboost multiple fields in Solr using BQ argument

44 views Asked by At

I am trying to deboost certain documents based on an attribute called department code. The following works:

bq=(*:* -department_code:"others")^10

However, when I want to add another department to the deboost, I try the following query and it fails (it ends up boosting "others" and "unisex" instead)

bq=(*:* -(department_code:"unisex" OR department_code:"others"))^10

What's wrong with my syntax? Note: it works as expected on solr UI using the new boost parameter but fails to perform as expected when API is called

1

There are 1 answers

0
carlosHT On

Have you tried:

bq=((*:* -department_code:"unisex") AND (*:* -department_code:"others"))^10

I think it should boost everything that is not "unisex" and "others", effectively deboosting "unisex" and "others".