# Mapper of different type, current\_type \[boolean\], merged\_type \[ObjectMapper\] - Elasticsearch bulk import

**URL:** <https://discuss.elastic.co/t/mapper-of-different-type-current-type-boolean-merged-type-objectmapper-elasticsearch-bulk-import/123001>\
**Category:** Elasticsearch\
**Created:** [March 8, 2018, 4:34am UTC](https://discuss.elastic.co/t/mapper-of-different-type-current-type-boolean-merged-type-objectmapper-elasticsearch-bulk-import/123001 "2018-03-08T04:34:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhilash\_Sathe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhilash_sathe/32/28555_2.png) [@Abhilash\_Sathe](https://discuss.elastic.co/u/Abhilash_Sathe)\
**Post date:** [March 8, 2018, 4:34am UTC](https://discuss.elastic.co/t/mapper-of-different-type-current-type-boolean-merged-type-objectmapper-elasticsearch-bulk-import/123001/1 "2018-03-08T04:34:47Z")

</div>

I'm currently using **Elasticsearch's** `_bulk` API to import a JSON dump.  
There is a field that has a dynamic data type, i.e. a `Boolean` type and an `Object` type.

Due to this, while importing the dump, elasticsearch throws an exception saying

```
{ type: 'illegal_argument_exception',
  reason: 'mapper **myfieldName** of different type, current_type [boolean], merged_type [ObjectMapper]' }

```

How can I handle this scenario?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 8, 2018, 6:07am UTC](https://discuss.elastic.co/t/mapper-of-different-type-current-type-boolean-merged-type-objectmapper-elasticsearch-bulk-import/123001/2 "2018-03-08T06:07:15Z")

</div>

I don't think you can. It can't be both an object and a native field.

---

<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:** [April 5, 2018, 6:07am UTC](https://discuss.elastic.co/t/mapper-of-different-type-current-type-boolean-merged-type-objectmapper-elasticsearch-bulk-import/123001/3 "2018-04-05T06:07:23Z")

</div>

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