Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to use negative query boost in lucene?

I want to penalize some terms in query, not to ignore them at all so "MUST NOT" operator will not work? Is it possible to use negative query boost with SHOULD in boolean query in lucene, how does it work?

like image 508
yura Avatar asked Dec 09 '10 13:12

yura


1 Answers

Yes, a query term boost is simply a multiplication factor, so setting it to a negative value will have the affect you want.

Here's a thread from the lucene mailing list discussing negative boost.

In summary in is like a NOT but less strict, in that matching documents will still appear in search results i.e.

Any positive score (>0) will have the affect of increasing the default score.

Any negative score (<0) will have the affect of decreasing the default score.

like image 120
Joel Avatar answered Sep 23 '22 04:09

Joel