Search code examples
searchsolrsolr-boost

solr how to properly use boost factor in a query?


Ok, so I am using many fields with qf, like:

[qf] => frpId^5 fundraise_title^3 fundraiser_display_name^3 charity_name^2 participantFname^2 participantLname^2 participantEmail^1 groupName^3 fundraise_text^ fundraiseTitleExact^15 fundraiserDisplayNameExact^15 charityNameExact^15 participantFnameExact^10 participantLnameExact^10 groupNameExact^10 all^

but I really want that exact matches for the field fundraiseTitleExact to be on top.

With this previous set up of qf, they are on the position 32.

Let's say that I am boosting fundraiseTitleExact like:

[qf] => frpId^5 fundraise_title^3 fundraiser_display_name^3 charity_name^2 participantFname^2 participantLname^2 participantEmail^1 groupName^3 fundraise_text^ fundraiseTitleExact^15000000000000000 fundraiserDisplayNameExact^15 charityNameExact^15 participantFnameExact^10 participantLnameExact^10 groupNameExact^10 all^

But even now the fundraiseTitleExact exact match is only on the position 27 (5 positions up) and is not going upper.

How can I prioritise this field over the rest?


Solution

  • This looks more like a tuning problem, however you have several options:

    1. Tune up your relevancy modifying all the boosts until you get the expected results (I would advise to work with lower boosts than the ones in your questions and then increase the boost of the most important field);

    2. If you are using edismax query parser then You probably want to check the bq and bf parameters in order to boost your term;

    3. If worse come to worst you could use Query Elevation Component to put some entries at the top of the list.

    I advise to read the following books to widen your knowledge of solr boosting and relevancy mechanisms: