def mapping_fields(mapping, parent=[]):
    """
    reads an elasticsearh mapping dictionary and returns a list of fields
    cojoined with a dot notation

    args:
        obj: the dictionary to parse
        parent: name for a parent key. used with a recursive call
    """
    rtn_obj = {}
    for key, value in mapping.items():
        new_key = parent + [key]
        new_key = ".".join(new_key)
        rtn_obj.update({new_key: value.get('type')})
        if value.get('properties'):
            rtn_obj.update(mapping_fields(value['properties'], [new_key]))
        elif value.get('fields'):
            rtn_obj.update(mapping_fields(value['fields'], [new_key]))
            rtn_obj[new_key] = [rtn_obj[new_key]] + \
                    list(value['fields'].keys())
    return rtn_obj