Function to get the index of a cluster in the list of clusters.