Getting mapper_parsing_exception while trying to create index in 7.8

Suppressed: org.elasticsearch.client.ResponseException: method [PUT], host [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}

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

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

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.

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!!!

Sharing that would be helpful for others :slight_smile:

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

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

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

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