Fix a bug in AbstractSimilaritySearch.java