3

Can anybody explain the differences between Query Elevation and Boost Query in solr. I couldn't find anything what are the Cons and what are the Pros of these two boosting mechanisms. Thank you very much.

LifeInstructor
  • 1,622
  • 1
  • 20
  • 24

1 Answers1

5

Boost Query

A boost query affects the score calculated - a document that didn't receive a large score might get boosted, but this boost might still not be enough to counteract the low score compared to other items. I.e. a boost query will increase the score of a document - attempting to make it more relevant based on certain criteria. It might not (and you might not want it to) be the top result, even with the boost applied.

An example is if you want to give any document with the label IMPORTANT higher weight, you can apply a boost query for that - bq=label:IMPORTANT.

But if you're searching for "a perfectly fine email" in a subject field, and you have an email where that actually is the subject, and you have another email that only have "email" as part of its subject - but it has been labeled important, the fact that the other email has been labeled important might not be a good enough reason to show it before the email that matches the subject completely. You'll have to tweak the values you use for boosting (i.e. label:IMPORTANT^<weight>) to get the result that works best for your exact use case.

Query Elevation

Query elevation is a way of saying "if someone searches for this, THIS document should be at the top" (or THIS document should not be included at all). I.e. these are manual adjustments of the search result based on a predetermined set of rules. The example from the manual is a good enough illustration, where the document MA147LL/A has been decided to be shown at the top if someone searches for ipod.

As you can see - "has been determined to be at the top" is different than "affect the score in some way" - it's just hardcoded to be at the top. If you search for this, you should see THIS at the top. Or you can apply the exclude attribute, which will remove the document from the returned set of documents (i.e. you are sure that you NEVER want to see a specific document when searching for ipod - but only when someone searches for that).

The query result component is often illustrated by how the older search engines used to have "Sponsored results" appear at the top of the regular search result, where certain documents in the search result where just shown before anything else.

This is sometimes called "sponsored search," "editorial boosting," or "best bets." This component matches the user query text to a configured map of top results. The text can be any string or non-string IDs, as long as it’s indexed. Although this component will work with any QueryParser, it makes the most sense to use with DisMax or eDisMax.

MatsLindh
  • 49,529
  • 4
  • 53
  • 84