@Shareable public class ConstantItemScorer extends AbstractItemScorer implements Serializable
Item scorer that returns a fixed score for all items.
Modifier and Type | Class and Description |
---|---|
static interface |
ConstantItemScorer.Value
The value used by the constant scorer.
|
Constructor and Description |
---|
ConstantItemScorer(double score)
Create a new constant item scorer.
|
Modifier and Type | Method and Description |
---|---|
ResultMap |
scoreWithDetails(long user,
Collection<Long> items)
Score a collection of items and potentially return more details on the scores.
|
score, score
@Inject public ConstantItemScorer(@ConstantItemScorer.Value double score)
Create a new constant item scorer.
score
- The score to return.@Nonnull public ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items)
ItemScorer
Score a collection of items and potentially return more details on the scores.
scoreWithDetails
in interface ItemScorer
user
- The user ID for whom to generate scores.items
- The item to score.ResultMap
that provides access to those details.