def _encode_doc(doc):
    """encode doc with utf-8 to cache into redis"""
    cache_obj = dict()
    for k, v in doc.iteritems():
        if isinstance(v, list) or isinstance(v, dict):
            continue
        if isinstance(v, str):
            cache_obj[k] = v.encode('utf-8')
        else:
            cache_obj[k] = v
    return cache_obj
