Skip to content

Commit

Permalink
Redis demo: Changed use case to use ufo tag occurence
Browse files Browse the repository at this point in the history
  • Loading branch information
Monika (momo13) committed May 10, 2013
1 parent 9964351 commit 6ab1e72
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions demos/Redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ Walkthrough
Query elements by their score in reverse order, starts with the highest score
redis> ZREVRANGE demo:photography 0 10

Query elements by their score in reverse order for a certain range of scores.
redis> ZREVRANGEBYSCORE demo:photography 10 0
redis> ZREVRANGEBYSCORE demo:photography +inf 0
redis> ZREVRANGEBYSCORE demo:photography 1 0

Load data into redis.
PREPARED:
> ruby load_delicious_data.rb data/delicious-rss # (~1250000 lines)
Expand All @@ -104,9 +99,14 @@ Walkthrough
Find 10 most popular tags:
redis> ZREVRANGE "delicious:all" 0 9 WITHSCORES

Find all that have been combined at least 1000 times:
redis> ZREVRANGEBYSCORE "delicious:all" +inf 1000 WITHSCORES
Find rank of ufo:
redis> ZREVRANK delicious:all ufo

How often used:
redis> ZSCORE delicious:all ufo

List all tags that have been combined with "ufo" sorted by popularity
redis> ZREVRANGE "delicious:ufo" 0 -1 WITHSCORES

List all tags that have been combined with "photography" sorted by popularity
redis> ZREVRANGE "delicious:photography" 0 -1
redis> ZREVRANGE "delicious:photography" 0 9
10 most popular tags combined with ufo
redis> ZREVRANGE "delicious:ufo" 0 9 WITHSCORES

0 comments on commit 6ab1e72

Please sign in to comment.