# Getting BulkIndexError When Trying to Write Documents to ElasticsearchDocumentStore()

**URL:** https://discuss.elastic.co/t/getting-bulkindexerror-when-trying-to-write-documents-to-elasticsearchdocumentstore/307894
**Category:** Elasticsearch
**Tags:** docker
**Created:** [June 22, 2022, 2:51pm UTC](https://discuss.elastic.co/t/getting-bulkindexerror-when-trying-to-write-documents-to-elasticsearchdocumentstore/307894 "2022-06-22T14:51:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Marsa\_Andari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marsa_andari/32/101721_2.png) [@Marsa\_Andari](https://discuss.elastic.co/u/Marsa_Andari)
#### Post date: [June 22, 2022, 2:51pm UTC](https://discuss.elastic.co/t/getting-bulkindexerror-when-trying-to-write-documents-to-elasticsearchdocumentstore/307894/1 "2022-06-22T14:51:03Z")

</div>

My goal is to write documents that I have from a csv file (around 700MB) but I received a BulkIndexError

Here is my code:

```auto
from haystack.document_stores.elasticsearch import ElasticsearchDocumentStore
document_store = ElasticsearchDocumentStore()

import pandas as pd 
df = pd.read_csv('D:\BISMILLAH FYP\FINAL_CORD_DATA.csv')

dicts = df.to_dict('records')

final_dicts = []
for each in dicts:
    tmp = {}
    tmp['content'] = each.pop('body_text')
    tmp['meta'] = each
    final_dicts.append(tmp)

document_store.write_documents(final_dicts)

```

All the lines were fine to run, except the last line which got me the error I mentioned. Please let me know if there is any ways to resolve this. Thank you

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 20, 2022, 2:52pm UTC](https://discuss.elastic.co/t/getting-bulkindexerror-when-trying-to-write-documents-to-elasticsearchdocumentstore/307894/2 "2022-07-20T14:52:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
