I have users like Redis Hashes and you want to find similar users (based on a specific user) based on salary and age.
<user> <id>101</id> <name>Neo</name> <age>30</age> <salary>300</salary> .... </user>
So, in this case, I need to find users who are close to my age and salary, close to my salary, as within certain limits. In SQL, I would hypothetically do something like
SELECT id, abs(age - 30) as agediff, abs(salary - 300) as saldiff FROM USERS WHERE (age BETWEEN 25 35) AND (salary BETWEEN 250 350) ORDER BY agediff ASC, saldiff ASC
Can we do this, say, using ZINTERSTORE, so that the result set is ordered in the likeness of a user, as in SQL?
source share