# \[Resolved\]Failed to index by helpers.bulk

**URL:** <https://discuss.elastic.co/t/resolved-failed-to-index-by-helpers-bulk/197296>\
**Category:** Elasticsearch\
**Created:** [August 29, 2019, 9:09am UTC](https://discuss.elastic.co/t/resolved-failed-to-index-by-helpers-bulk/197296 "2019-08-29T09:09:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cheriemilk](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@cheriemilk](https://discuss.elastic.co/u/cheriemilk)\
**Post date:** [August 29, 2019, 9:09am UTC](https://discuss.elastic.co/t/resolved-failed-to-index-by-helpers-bulk/197296/1 "2019-08-29T09:09:03Z")

</div>

Hi team,

below is the python code.

> ```
> from elasticsearch import helpers,Elasticsearch
> import csv
> es = Elasticsearch()
> with open('testcase0801.csv') as f:
> reader = csv.DictReader(f)
> helpers.bulk(es,reader,index='testcase',doc_type='my_doc')
> 
> ```

When I executing this, I got below error  
File "C:\Users\I073341\AppData\Local\Continuum\anaconda3\lib\site-packages\elasticsearch\helpers\__init_\_.py", line 137, in \_process\_bulk\_chunk  
raise BulkIndexError('%i document(s) failed to index.' % len(errors), errors)

`

> BulkIndexError: ('93 document(s) failed to index.', [{'index': {'\_index': 'testcase', '\_type': 'my\_doc', '\_id': 'UfmR3GwBvy4j84MHhSUQ', 'status': 400, 'error': {'type': 'illegal\_argument\_exception', 'reason': 'Rejecting mapping update to [testcase] as the final mapping would have more than 1 type: [\_doc, my\_doc]'}, 'data': OrderedDict([('caseid', 'com.successfactors.test.qray.cases.talent.scm......  
> `  
> what's the issue here?

---

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [August 29, 2019, 9:53am UTC](https://discuss.elastic.co/t/resolved-failed-to-index-by-helpers-bulk/197296/2 "2019-08-29T09:53:32Z")

</div>

From v 6.0, Elasticsearch doesn't support multiple mapping types in one index.  
In your case, you have more than 1 type:[\_doc,my\_doc]. Just set doc\_type='\_doc' can skip the issue.

---

<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:** [September 26, 2019, 9:53am UTC](https://discuss.elastic.co/t/resolved-failed-to-index-by-helpers-bulk/197296/3 "2019-09-26T09:53:34Z")

</div>

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