Updated search method to work with one or more entities