Root mapping definition has unsupported parameters: Elastic Search

I am getting the following error when I am trying to create elastic index in SuiteCRM 7.11.8. Not able to understand what is wrong here?

vendor/bin/robo elastic:index
[=][14:47:40] Starting indexing procedures
[@][14:47:40] Indexing is performed using JsonSerializerDocumentifier
[@][14:47:40] Reading lock file cache/ElasticSearchIndexer.lock
[@][14:47:40] Lock file not found
[@][14:47:40] A full indexing will be performed
[@][14:47:40] Removed index ‘main’
[@][14:47:40] Loading mapping file /var/www/html/Pramerica/dev/lib/Search/ElasticSearch/defaultParams.yml
[error] {“error”:{“root_cause”:[{“type”:“mapper_parsing_exception”,“reason”:“Root mapping definition has unsupported parameters: [default : {properties={named={type=text, fields={keyword={ignore_above=256, type=keyword}}}, name={properties={last={copy_to=named, type=text, fields={keyword={ignore_above=256, type=keyword}}}, name={copy_to=named, type=text, fields={keyword={ignore_above=256, type=keyword}}}, first={copy_to=named, type=text, fields={keyword={ignore_above=256, type=keyword}}}}}}}]”}],“type”:“mapper_parsing_exception”,“reason”:“Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [default : {properties={named={type=text, fields={keyword={ignore_above=256, type=keyword}}}, name={properties={last={copy_to=named, type=text, fields={keyword={ignore_above=256, type=keyword}}}, name={copy_to=named, type=text, fields={keyword={ignore_above=256, type=keyword}}}, first={copy_to=named, type=text, fields={keyword={ignore_above=256, type=keyword}}}}}}}]”,“caused_by”:{“type”:“mapper_parsing_exception”,“reason”:“Root mapping definition has unsupported parameters: [default : {properties={named={type=text, fields={keyword={ignore_above=256, type=keyword}}}, name={properties={last={copy_to=named, type=text, fields={keyword={ignore_above=256, type=keyword}}}, name={copy_to=named, type=text, fields={keyword={ignore_above=256, type=keyword}}}, first={copy_to=named, type=text, fields={keyword={ignore_above=256, type=keyword}}}}}}}]”}},“status”:400}

Please let me know how to fix it?

Hi, you probably installed elasticsearch 7, which doesn’t support mapping types. SuiteCRM is not compatible to this elasticsearch version.

https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html

Try to downgrade your elasticsearch version to version 5.6.

The following pull fixes the error above, however it will still fail to index, because the mapping is not compatible with elasticsearch 6+