There is a product database; the popularity value for products is periodically calculated. An index has been built in ES, there is sorting by popularity value.
There is a task to screw up a recommendation system. The recommendation system for each user_id produces N recommended products with a recommendation value from 0 to 1.
It is required to display products for each user in this way: first those with popularity >A (top products) sorted by popularity, then recommended for the user (sorted), then all the rest sorted by popularity.
How can this sorting be implemented at the ES level? How to put user recommendations there?
Have you had a look at specifying multiple fields for sorting, as per the 2nd example here in the documentation? Alternatively you could like at creating a scripted sorting if that doesn't quite achieve what you need.
Hope that helps!
Hi, thanks! Can I sort in ES using vector of ids. For example, I want at first to get docs with id 8, 567, 234 and then another docs