def es_field_sort ( fld_name ) : parts = fld_name . split ( "." ) if "_" not in parts [ - 1 ] : parts [ - 1 ] = "_" + parts [ - 1 ] return "." . join ( parts )
python how to modify all field names
Used with lambda to sort fields
def es_field_sort(fld_name):
    """ Used with lambda to sort fields """
    parts = fld_name.split(".")
    if "_" not in parts[-1]:
        parts[-1] = "_" + parts[-1]
    return ".".join(parts)