Custom ranking based on array of string

I had a usecase where i want to serach user and prioritize the results based on list of accounts user is following.
I’m planning to store the list of accounts in an array against the user
Will it be possible to prioritize the search based on this?