Question

I am going to index documents that will have Boost values from 1 to 10. One way is to simply use AddWithBoost(doc , boostvalue) . But is this the correct way? Do I need to translate the scale (1 - 10) to some other range in order to make sure that document with boost value 10 is ranked higher than one with value 9 for some query? I guess what I am looking for is the standard way of using Boost.

Was it helpful?

Solution

AddWithBoost boosts documents at index-time. You can also boost fields at index-time by appending a boost value to the property attribute, e.g.:

[SolrField("thesolrfield", Boost = 20)]
public string Something { get; set; }

Take a look at this question and the Lucene similarity docs for more information on using boosts.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top