Updated
migrated search logic into posts_controller