# Getting mapper\_parsing\_exception while trying to create index in 7.8

**URL:** https://discuss.elastic.co/t/getting-mapper-parsing-exception-while-trying-to-create-index-in-7-8/246204
**Category:** Elasticsearch
**Created:** [August 25, 2020, 1:08am UTC](https://discuss.elastic.co/t/getting-mapper-parsing-exception-while-trying-to-create-index-in-7-8/246204 "2020-08-25T01:08:10Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![elastic78](https://avatars.discourse-cdn.com/v4/letter/e/8edcca/32.png) [@elastic78](https://discuss.elastic.co/u/elastic78)
#### Post date: [August 25, 2020, 1:08am UTC](https://discuss.elastic.co/t/getting-mapper-parsing-exception-while-trying-to-create-index-in-7-8/246204/1 "2020-08-25T01:08:10Z")

</div>

Suppressed: org.elasticsearch.client.ResponseException: method [PUT], host [[http://localhost:9200](http://localhost:9200)], URI [/ise?master\_timeout=30s&timeout=30s], status line [HTTP/1.1 400 Bad Request]  
{"error":{"root\_cause":[{"type":"mapper\_parsing\_exception","reason":"Root mapping definition has unsupported parameters:  
sample data : "LastName":{"type":"text","analyzer":"case\_insensitive\_analyzer","fielddata":true},"Location":{"type":"text","analyzer":"case\_insensitive\_analyzer","fielddata":true}

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [August 25, 2020, 1:25am UTC](https://discuss.elastic.co/t/getting-mapper-parsing-exception-while-trying-to-create-index-in-7-8/246204/2 "2020-08-25T01:25:44Z")

</div>

Are you asking for assistance here, or just posting the error?

If you are asking for assistance, what does your mapping request look like?

---

<div class="post-metadata">

### Author: ![elastic78](https://avatars.discourse-cdn.com/v4/letter/e/8edcca/32.png) [@elastic78](https://discuss.elastic.co/u/elastic78)
#### Post date: [August 25, 2020, 5:14am UTC](https://discuss.elastic.co/t/getting-mapper-parsing-exception-while-trying-to-create-index-in-7-8/246204/3 "2020-08-25T05:14:03Z")

</div>

Hi Warkolm,  
Couldn't post my question completely. We are migrating from 5.5 to 7.8. In 5.5 we are using types. I am trying to create index using CreateIndexRequest. In request.mapping i am addding the below mapping  
{  
"index":{  
"analysis":{  
"analyzer":{  
"case\_insensitive\_analyzer":{  
"tokenizer":"keyword",  
"filter":"lowercase"}}}}}  
Also, how can I set include\_type\_name attribute to true, while creating indexrequest using java API. Also, do we need to add \_doc parameter in the schema. I see some blogs mentioning to remove it in 7.x. I am trying to create custom type using type keyword, where can I specify the type names in my java API which creating elastic search indices. Below is schema I am using  
{"properties":{ "PortalUser":{  
"type":"text",  
"analyzer":"case\_insensitive\_analyzer",  
"fielddata":true  
}}}  
Let me know if you need any further info.

---

<div class="post-metadata">

### Author: ![elastic78](https://avatars.discourse-cdn.com/v4/letter/e/8edcca/32.png) [@elastic78](https://discuss.elastic.co/u/elastic78)
#### Post date: [August 25, 2020, 9:44pm UTC](https://discuss.elastic.co/t/getting-mapper-parsing-exception-while-trying-to-create-index-in-7-8/246204/4 "2020-08-25T21:44:46Z")

</div>

I figured out the error and now able to create the index. I have one question on custom types.  
So if I an have index say twitter and i have created type tweet, so how can I insert data into tweet custom type; I am trying this  
key is the unique value which I will use in search later  
BulkProcessor.processRequest( new UpdateRequest("twitter",key).doc(entireobject).upsert(new IndexRequest("twitter").id(key).source(entireobject)));  
where do I need to give the custom type. Can you point me to sample custom type creation and data insertion in java if available. This will be of great help.  
Thanks!!!

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [August 25, 2020, 10:33pm UTC](https://discuss.elastic.co/t/getting-mapper-parsing-exception-while-trying-to-create-index-in-7-8/246204/5 "2020-08-25T22:33:33Z")

</div>

> [@elastic78](#):
>
> I figured out the error and now able to create the index

Sharing that would be helpful for others 🙂

> [@elastic78](#):
>
> I have one question on custom types.

Don't use types, they are deprecated in 7.X and will be removed in 8.0.

---

<div class="post-metadata">

### Author: ![elastic78](https://avatars.discourse-cdn.com/v4/letter/e/8edcca/32.png) [@elastic78](https://discuss.elastic.co/u/elastic78)
#### Post date: [August 25, 2020, 11:20pm UTC](https://discuss.elastic.co/t/getting-mapper-parsing-exception-while-trying-to-create-index-in-7-8/246204/6 "2020-08-25T23:20:00Z")

</div>

In code I was adding index to mapping which is not allowed in 7.8. Once I removed it started working

---

<div class="post-metadata">

### Author: ![elastic78](https://avatars.discourse-cdn.com/v4/letter/e/8edcca/32.png) [@elastic78](https://discuss.elastic.co/u/elastic78)
#### Post date: [August 25, 2020, 11:22pm UTC](https://discuss.elastic.co/t/getting-mapper-parsing-exception-while-trying-to-create-index-in-7-8/246204/7 "2020-08-25T23:22:57Z")

</div>

We are unsing bulk processor to add the new requests and I see in 7.8 builder(client,listener) is deprecates. So I am creating bulkconsumer and using it.  
BiConsumer\<BulkRequest, ActionListener\> bulkConsumer = (request, bulkListener) -\> client  
.bulkAsync(request, RequestOptions.DEFAULT, bulkListener);  
Is it the right way to create bulk processor instance?  
Also, we don't use java 8, i tried to remove lambda and replace with Java 7 style but did not work. Can you help me replace the code without lambda's

---

<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 22, 2020, 11:23pm UTC](https://discuss.elastic.co/t/getting-mapper-parsing-exception-while-trying-to-create-index-in-7-8/246204/8 "2020-09-22T23:23:00Z")

</div>

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