Open dontLoveBugs opened 6 years ago
from lshash import LSHash lsh = LSHash(6, 8, storage_config={"redis":{"host":'localhost',"port":6379}}) lsh.index([1, 2, 3, 4, 5, 6, 7, 8]) lsh.index([2, 3, 4, 5, 6, 7, 8, 9]) lsh.index([10, 12, 99, 1, 5, 31, 2, 3]) print(lsh.query([1, 2, 3, 4, 5, 6, 7, 7]))
change tuples = json.loads(json_or_tuple)[0] to tuples = json.loads(json_or_tuple) in the source code
from lshash import LSHash lsh = LSHash(6, 8, storage_config={"redis":{"host":'localhost',"port":6379}}) lsh.index([1, 2, 3, 4, 5, 6, 7, 8]) lsh.index([2, 3, 4, 5, 6, 7, 8, 9]) lsh.index([10, 12, 99, 1, 5, 31, 2, 3]) print(lsh.query([1, 2, 3, 4, 5, 6, 7, 7]))