city = {'id': fields[0], 'city': fields[1]}
cities.append(cities)
if len(cities) == 1000:
    es.bulk_index(es_index, 'city', cities, id_field='id')
cities = []
if len(cities) > 0:
    es.bulk_index(es_index, 'city', cities, id_field='id')
elasticsearch bulk indexing using python