I have indexed some documents that have title, content and keyword (multi-value).
I want to search on title and content, and then, within these results boost by keyword.
I have set up my qf as such:
<str name="qf">
content^0.5 title^1.0
</str>
And my bq as such:
<str name="bq">keyword:(*.*)^1.0</str>
But I’m fairly sure that this is boosting on all keywords (not just ones matching my search term)
Does anyone know how to achieve what I want (I’m using the DisMax query request handler btw.)
I don’t think that’s how the boost works. Boost is supposed to specify the importance of a match on a specific field.
So by doing something like
content^0.5 title^1.0 keyword^5.0, you can make your queries give extra importance to the keyword.You might be able to force it by doing a complex query. For instance you can use the “+” operator to make it required. So something like this if you were searching for “query”: