I just read much documents regarding to assign a static boost to a specific document at index time. Some of the docs and function are deprecated. So I am not sure what to use for this particular use case:
I index two simple documents:
Germany and Gerogia in the same index. Germany should have a higher ranking by default because its a country.
Whats the best ways to get this working?
And is this article a good source to get it working?
Some additional information regarding my researches today.
One option is to use field_value_factor. Which means I create a new field in my document similar to weight to calculate the score by query time. Docs
An additional or other option is the boost on a specific field. In simple words I create another field in my document for example country:boolean and by query time I boost the field country by any value if its true. Docs
Since then the function score query has improved, with options such
as field_value_factor. The main takeaway is the same, function scores after
the scoring, to me at least, are more consistent and easier to read.
Thanks Ivan, nice post. Makes some stuff more clear. I will need the stuff for autocomplete functions. If you have any other related documents to share, would be good the have those.
Quite a few things have changed in the past four years since I wrote that
blog post, such as more options in the function score query and field norms
have more precision besides a single byte in Lucene. But ultimately, such
logic does not belong in TD-IDF/BM-25, but outside of it. Besides, with
function scores, you can change the boost level on the fly whenever you
create the query. Waaaaay easier to A/B test different values.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.