Prioritize display of items that match a certain list

I have an RG that displays all the data in Do a search, and the user has a list of favorites for some of this data.
In this case, how should I design a formula to display the list that the user has registered as favorites first, and then display the rest?
Do I need to make two RGs?

current users list of favourites merged with do a search for X