Solr Boosting failed

193 Views Asked by At

We have following fields that should be prioritized in the search results as below

Name (Priority 1)
Code (Priority 2)
Description (Priority 3)
Short description (Priority 4)

Boost query we applied:

bq=(Name)^50&bq=(Code)^40&bq=(Description)^30&bq=(Short description)^20

Issue Description:

Boosting is not working as Priority3 items comes to top than Priority2.

Search results output:

Name (Priority 1)

Description (Priority 3)

Code (Priority 2)

Short description (Priority 4)

What we have done to fix the issue:

We applied constant score (^=) and also tried to give high score for code (P2) than Description (P3), but that also not giving expected results.

What we need:

Search results should be ordered based on priority specified as per boosting value.

Please advise.

1

There are 1 best solutions below

0
koponk On

This is how you use bq :

/select?q=*:*&bq=name:*^100&bq=code:*^100&defType=edismax&fl=score,*

you apply 'new query' to be boosted.

This is how you use bf :

/select?defType=edismax&fl=score,*&q=*:*&bf=numeric_field^1.5

you can read more in solr query parser on how to use/limitation of bf/bq