推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
yuptyy
V2EX  ›  Python

redis 查找的问题

  •  
  •   yuptyy · Nov 26, 2015 · 4008 views
    This topic created in 3996 days ago, the information mentioned may be changed or developed.

    redis
    现在有如下数据

    tag:userid:1 js php python html
    tag:userid:2 php python
    tag:userid:3 html php
    ..
    ..
    ..

    如何找出有相同兴趣的 比如 同时包含 python 的 key 如何实现?

    7 replies  •  2015-11-27 09:40:26 +08:00
    c4pt0r
    c4pt0r
    Nov 26, 2015❤️1
    1
    你这个想高效,只能反向建索引
    nigelvon
    nigelvon
    Nov 26, 2015❤️1
    2
    这种场景用 redis 不合适。
    trigged
    trigged
    Nov 26, 2015❤️1
    3
    冗余,再建一个 set <python>:[uid1,uid2]
    xujif
    xujif
    Nov 26, 2015
    4
    反向索引+1
    knightdf
    knightdf
    Nov 26, 2015
    5
    查内容,只能反向索引
    newghost
    newghost
    Nov 26, 2015❤️1
    6
    创建一个只有 python 的 set
    新建一个 set 或 zset
    tag:python user:1 user:2 user:3


    redblade 就是用来干这个的, 用 node.js 实现

    https://github.com/newghost/redblade
    xiamingchong
    xiamingchong
    Nov 27, 2015
    7
    上 es 吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1399 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 22:49 · PVG 06:49 · LAX 14:49 · JFK 17:49
    ♥ Do have faith in what you're doing.