Stealing this example (Format the output of elasticsearch-py)
import logging
logging.basicConfig()
from elasticsearch import Elasticsearch as ES
print "Setup connection..."
es=ES(['localhost:8080'])
print "Done!"
print "Count number of users..."
print es.count(index='users')
Results like:
{u'count': 836780, u'_shards': {u'successful': 5, u'failed': 0, u'total': 5 ... ... }}
Except what I want to do is convert ^ to a csv
Should I try to convert it back to json then to csv or anyway i can convert it directly?