Rank candidate embeddings against a query using the selected similarity metric and return the top-k indices.