code: @Override
    protected GroupShardsIterator shards(ClusterState clusterState, TermsByQueryRequest request, String[] concreteIndices) {
      Map<String, Set<String>> routingMap = indexNameExpressionResolver.resolveSearchRouting(clusterState, request.routing(), request.indices());
      return clusterService.operationRouting().searchShards(clusterState, concreteIndices, routingMap, request.preference());
    }
docs: The shards this request will execute against.