diff --git a/datasketch/lshforest.py b/datasketch/lshforest.py index bee6f29c..5bd2aeff 100644 --- a/datasketch/lshforest.py +++ b/datasketch/lshforest.py @@ -112,15 +112,15 @@ def query(self, minhash, k): raise ValueError("k must be positive") if len(minhash) < self.k*self.l: raise ValueError("The num_perm of MinHash out of range") - results = set() + results = {} r = self.k while r > 0: for key in self._query(minhash, r, self.l): - results.add(key) + results[key]='' if len(results) >= k: - return list(results) + return list(results.keys()) r -= 1 - return list(results) + return list(results.keys()) def _binary_search(self, n, func): '''