adds grouping to searches