Scores from Index at extra positions are not filtered out
Hi! Yes, that makes sense! Would you like to submit a PR to fix this? Created PR https://github.com/huggingface/datasets/pull/3971
If a FAISS index has fewer records than the requested number of top results (k), then it returns -1 in indices for the additional positions. The get_nearest_examples method only filters out the extra results from the dataset samples. It would be better to filter out extra scores too.

Reference: https://github.com/huggingface/datasets/blob/2.0.0/src/datasets/search.py#L693
