@staticmethod
def deindex(db, key, doc, tokens, **kwargs):
    for name in config.FILTERS:
        values = doc.get(name)
        if values:
            if (not isinstance(values, (list, tuple))):
                values = [values]
            for value in values:
                db.srem(keys.filter_key(name, value), key)
    if ('type' in config.FILTERS):
        db.srem(keys.filter_key('type', 'housenumber'), key)
@staticmethod
def deindex(db, key, doc, tokens, **kwargs):
    for name in config.FILTERS:
        values = doc.get(name)
        if values:
            if (not isinstance(values, (list, tuple))):
                values = [values]
            for value in values:
                db.srem(keys.filter_key(name, value), key)
    if ('type' in config.FILTERS):
        db.srem(keys.filter_key('type', 'housenumber'), key)