def squash_dates(obj):
    if isinstance(obj, dict):
        obj = dict(obj) # don't clobber
        for k,v in obj.items():
            obj[k] = squash_dates(v)
    elif isinstance(obj, (list, tuple)):
        obj = [ squash_dates(o) for o in obj ]
    elif isinstance(obj, datetime):
        obj = obj.strftime(ISO8601)
    return obj
Yields all terms in the given field.
dataset/ETHPy150Open ipython/ipython-py3k/IPython/utils/jsonutil.py/squash_dates--crossover with--dataset/ETHPy150Open dokipen/whoosh/src/whoosh/reading.py/IndexReader.lexicon