add filter/search functions to posts controller