Aizaz
Aizaz

Reputation: 79

How to deboost multiple fields in Solr using BQ argument

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

Upvotes: 0

Views: 99

Answers (1)

carlosHT
carlosHT

Reputation: 493

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".

Upvotes: 0

Related Questions