Boost search results in Lucene via the presence of a field value

Oakwood Admin asked on September 22, 2017 12:26

I am trying to boost a search result with the presence of a value in a field. Unfortunately boosting a search term doesn't do what I want, as it includes that field value as a search term, which changes the scoring anyway, boost or no boost.

Failing that, if I use two indexes can I boost results from one index above another?

My question also on stackoverflow.com https://stackoverflow.com/questions/46304893/boost-search-results-in-lucene-via-the-presence-of-a-field-value/

Recent Answers


Trevor Fayas answered on September 22, 2017 19:19

Shouldn't need to double post, here's in addition to my comment, since you are not using the "Search Condition" and just not satisfied with how it's boosting results, you will need to set boost values for your normal search as well. Set primary search as boost 2 (^2) then your additional term as boost 0.5 (^0.5), and adjust till it does what you want.

In the end Lucene takes each optional filter and assigns a value to them based on the match, multiplied by the boost value, and adds it up to get your weight.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.