def index_job_years(conn, job_id, skill_years):
    total_skills = len(set(skill for skill, level in skill_years))
    pipeline = conn.pipeline(True)
    for skill, years in skill_years:
        pipeline.zadd(
            'idx:skill:%s:years'%skill, job_id, max(years, 0))
    pipeline.sadd('idx:jobs:all', job_id)
    pipeline.zadd('idx:jobs:req', job_id, total_skills)
dataset/ETHPy150Open huangz1990/riacn-code/ch07_listing_source.py/index_job_years/original