groupBy variant of indexBy