I have documents like below
{type: bacon, last_used: 1}
{type: fruit, last_used: 2}
{type: bread, last_used: 3}
{type: juice, last_used: 4}
{type: bacon, last_used: 5}
{type: juice, last_used: 6}
is it possible to sort on last_used
AND also specify a value for the type
field like bacon that should carry more weight and be listed first in results ?
So if someone really likes bacon they will always get bacon with last used on top but if they enter a unknown food type then they'll still get results.
I can think of client side ways to achieve but I want to do it server-side.