code: func (e *executor) shardsByNode(nodes []*Node, index string, shards []uint64) (map[*Node][]uint64, error) {
  	m := make(map[*Node][]uint64)
  
  loop:
  	for _, shard := range shards {
  		for _, node := range e.Cluster.ShardNodes(index, shard) {
  			if Nodes(nodes).Contains(node) {
  				m[node] = append(m[node], shard)
  				continue loop
  			}
  		}
  		return nil, errShardUnavailable
  	}
  	return m, nil
  }
docs: // shardsByNode returns a mapping of nodes to shards.
  // Returns errShardUnavailable if a shard cannot be allocated to a node.