Making KNN sparse (using InvertedIndex)