better query for categories with search param