Create search method in posts model