# Where to find examples of bulk indexing for ES6?

**URL:** <https://discuss.elastic.co/t/where-to-find-examples-of-bulk-indexing-for-es6/127212>\
**Category:** Elasticsearch\
**Created:** [April 8, 2018, 12:54pm UTC](https://discuss.elastic.co/t/where-to-find-examples-of-bulk-indexing-for-es6/127212 "2018-04-08T12:54:06Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![timogoosen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timogoosen/32/29750_2.png) [@timogoosen](https://discuss.elastic.co/u/timogoosen)\
**Post date:** [May 7, 2018, 8:31am UTC](https://discuss.elastic.co/t/where-to-find-examples-of-bulk-indexing-for-es6/127212/9 "2018-05-07T08:31:34Z")

</div>

I see someone else solved it also in my old thread.

> [@Looking for working example data set to bulk index into ES6](https://discuss.elastic.co/t/looking-for-working-example-data-set-to-bulk-index-into-es6/128678/3):
>
> I got the auto generate id posting right with the bulk api via: $ chmod +x convert.py $ cat convert.py #!/usr/bin/env python src\_file = 'src\_file.json' dest\_file = 'dest\_file.json' metadata = '{"index": {"\_index": "bank\_accounts", "\_type": "account"}}' with open(src\_file) as open\_file: lines = open\_file.readlines() lines = [line.replace(' ', '') for line in lines] with open(dest\_file, 'w') as f: for each\_line in lines: f.write(metadata + '\n') f.writelines(each\_lin…

Thanks for your help. Seemed like I had a small issue with how I was iterating over each document in my python code. Thanks for your help!

---

_[View the full topic](https://discuss.elastic.co/t/where-to-find-examples-of-bulk-indexing-for-es6/127212)._
