I have a single JSON file formatted like:
{"index":{"_type": "summary", "_id": "0001-1200-2015-12-31-0007", "_index": "transaction"}}
{"data_load_user_id": "nathan", "tender_time": 5, "ring_time": 8, "operator_id": "0111"}
for about 12,000 rows. As far as I know, this is the correct way to format a JSON file for the bulk API in elasticsearch. I'm still confused on how to use es.bulk() with this single file as input. I already have the index and id specified for each row.
elasticsearch.helpers.bulk(). I'm pretty sure you can pass a list containing your rows and it will do the right thing. Edit: here's the documentation: elasticsearch-py.readthedocs.org/en/master/…AttributeError: 'str' object has no attribute 'copy'dict(which gets converted back to JSON).