@staticmethod
def index(pipe, 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:
                pipe.sadd(keys.filter_key(name, value), key)
    if (('type' in config.FILTERS) and config.HOUSENUMBERS_FIELD and doc.get(config.HOUSENUMBERS_FIELD)):
        pipe.sadd(keys.filter_key('type', 'housenumber'), key)
@staticmethod
def index(pipe, 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:
                pipe.sadd(keys.filter_key(name, value), key)
    if (('type' in config.FILTERS) and config.HOUSENUMBERS_FIELD and doc.get(config.HOUSENUMBERS_FIELD)):
        pipe.sadd(keys.filter_key('type', 'housenumber'), key)