November 2018
Intermediate to advanced
300 pages
7h 42m
English
It often happens that some business rules require us to boost the score of the selected items. In the book dataset, for example, if a book is recent, we want to give it a higher score. That's possible by using the IDRescorer interface, as follows:
Our example can be implemented as follows:
class MyRescorer implements IDRescorer { public double rescore(long itemId, double originalScore) { double newScore = originalScore; if(bookIsNew(itemId)){ originalScore *= 1.3; } return newScore; } public boolean ...