Skip to content

Instantly share code, notes, and snippets.

@guyroyse
Created December 20, 2019 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guyroyse/2d6c82c3ea5e45cc1677a47f58acd64c to your computer and use it in GitHub Desktop.
Save guyroyse/2d6c82c3ea5e45cc1677a47f58acd64c to your computer and use it in GitHub Desktop.
The TopK is Out There
from redisbloom.client import Client
client = Client()
client.topkReserve('ufo_words', k=10, width=400,
depth=10, decay=0.9)
# lots of code to get some words...
[client.topkAdd('ufo_words', w) for w in words]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment