Ivo Kurtanovic
Ivo Kurtanovic

Reputation: 41

In SOLR, how can I make to type of documents more relevant then other types?

In the ranked list returned by SOLR, I want to have documents of category with "Sports" coming before than those with the "Politics" and "Economy". How can I tune the SOLR Search Engine to achieve this?

Upvotes: 0

Views: 19

Answers (1)

MatsLindh
MatsLindh

Reputation: 52912

You can use a boost query:

bq=category:Sports^3

This means that you'll have a separate query that is used to boost the score of the other result set, and those that match will get boosted three times as much as those that doesn't match.

Append debugQuery=true to your query string to see how the boost is processed for each document.

If you don't want to actually use relevancy for this, but ALWAYS show Sports first (even if it's a lousy match compared to the matches for the other types), you're talking about sorting - and not relevancy. In that case, either apply a very, very large boost or use a function as your sort parameter with if(...).

Upvotes: 1

Related Questions