We have a usecase where we want to push a popularity boost for each
document in our collection. When a user searches for any term, we would
like to arbitrarily add an additional boost by this value (which is
different for each document).
Should we define the field 'popularityBoostField' as a docValue or regular
If the field is sparsely filled, will that cause any issues?
We, at Auto-Suggest, had the similar requirement. We wanted to boost
suggestions as per their demand. For this, we also introduced a new
*integer* field *demand*. We simply boosted it by (we use some mathematical
transformations so showing the basic version here):
We use eDismax query parser. Since this is a numeric field, you get the
uninverted index (uninvertible = true) by default. Anyways, as the
recommendations in docValues section
using docValues for fields on you expect to do faceting, sorting and
function queries, we enabled docValues for demand and tried the performance
gain in using boost for demand.
*Well, we didn't see any significant gains by enabling docValues on a
numeric field. *