Andy Cox
Andy Cox

Reputation: 51

Boost results in Solr by certain field?

I'm pretty new to Solr but I'm trying to integrate it in to my website. I've been looking in ways to "boost" results in Solr queries, but I'm having a hard time understanding how to achieve what I'm trying to do.

I'm trying to "boost" certain results in Solr searches that have the field "userId" set to 1. For example, if there were two documents in the index that had the exact same text relevance but the first document had the "userId" field set to "1" and the other had it set to "4", then the first document would be positioned higher in the results.

Is there anyway I can do this? Thank you very much!

Upvotes: 5

Views: 5731

Answers (2)

2ni
2ni

Reputation: 507

use "&sort=score desc,userId asc" as parameter might help

Upvotes: -3

Mauricio Scheffer
Mauricio Scheffer

Reputation: 99730

There are several ways you can do this:

Also take a look at the Solr relevancy FAQ where this kind of questions are answered.

Upvotes: 6

Related Questions