Edit search method to work with postgres