Below is the statement of mapping and settings derived from existing Index of version 5.6.3
curl -X PUT "localhost:9200/myindex?pretty" -H 'Content-Type: application/json' -d'
{
"settings": {
"index": {
"codec": "best_compression",
"routing": {
"allocation": {
"require": {
"box_type": "warm"
}
}
},
"number_of_shards": "5",
"blocks": {
"read_only_allow_delete": "true"
}
}
} ,
"mappings": {
"mytype": {
"properties": {
"@timestamp": {
"type": "date"
},
"actconn": {
"type": "text",
...
....
ERROR while creating same in Elasticsearch version 7.8.0 ==>
This is expected as in ES v5.6.3 we have mapping defined as"mytype"
, while in ES 7.8.0 its removed.
My question is how should i remove "mytype" while getting STATEMENT generated from existing indices of v5.6.3 as /_mapping
includes TYPE NAME for v5.6.3
{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [mytype : {properties={date={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tt={type=text, fields={keyword={ignore_above=256, type=keyword}}}, request={type=text, fields={keyword={ignore_above=256, type=keyword}}}, actconn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, ps={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tw={type=text, fields={keyword={ignore_above=256, type=keyword}}}, srv_conn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, f_end={type=text, fields={keyword={ignore_above=256, type=keyword}}}, pid={type=text, fields={keyword={ignore_above=256, type=keyword}}}, hostname={type=text, fields={keyword={ignore_above=256, type=keyword}}}, beconn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, host={type=text, fields={keyword={ignore_above=256, type=keyword}}}, req_headers={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tag={type=text, fields={keyword={ignore_above=256, type=keyword}}}, b_server={type=text, fields={keyword={ignore_above=256, type=keyword}}}, feconn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, privateip={type=text, fields={keyword={ignore_above=256, type=keyword}}}, srv_queue={type=text, fields={keyword={ignore_above=256, type=keyword}}}, res_cookie={type=text, fields={keyword={ignore_above=256, type=keyword}}}, req_cookie={type=text, fields={keyword={ignore_above=256, type=keyword}}}, c_ip={type=text, fields={keyword={ignore_above=256, type=keyword}}}, b_end={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tc={type=text, fields={keyword={ignore_above=256, type=keyword}}}, backend_queue={type=text, fields={keyword={ignore_above=256, type=keyword}}}, retries={type=text, fields={keyword={ignore_above=256, type=keyword}}}, @timestamp={type=date}, logName={type=text, fields={keyword={ignore_above=256, type=keyword}}}, bytes={type=text, fields={keyword={ignore_above=256, type=keyword}}}, status code={type=text, fields={keyword={ignore_above=256, type=keyword}}}, time={type=text, fields={keyword={ignore_above=256, type=keyword}}}, t_state={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tq={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tr={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: [mytype : {properties={date={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tt={type=text, fields={keyword={ignore_above=256, type=keyword}}}, request={type=text, fields={keyword={ignore_above=256, type=keyword}}}, actconn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, ps={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tw={type=text, fields={keyword={ignore_above=256, type=keyword}}}, srv_conn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, f_end={type=text, fields={keyword={ignore_above=256, type=keyword}}}, pid={type=text, fields={keyword={ignore_above=256, type=keyword}}}, hostname={type=text, fields={keyword={ignore_above=256, type=keyword}}}, beconn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, host={type=text, fields={keyword={ignore_above=256, type=keyword}}}, req_headers={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tag={type=text, fields={keyword={ignore_above=256, type=keyword}}}, b_server={type=text, fields={keyword={ignore_above=256, type=keyword}}}, feconn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, privateip={type=text, fields={keyword={ignore_above=256, type=keyword}}}, srv_queue={type=text, fields={keyword={ignore_above=256, type=keyword}}}, res_cookie={type=text, fields={keyword={ignore_above=256, type=keyword}}}, req_cookie={type=text, fields={keyword={ignore_above=256, type=keyword}}}, c_ip={type=text, fields={keyword={ignore_above=256, type=keyword}}}, b_end={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tc={type=text, fields={keyword={ignore_above=256, type=keyword}}}, backend_queue={type=text, fields={keyword={ignore_above=256, type=keyword}}}, retries={type=text, fields={keyword={ignore_above=256, type=keyword}}}, @timestamp={type=date}, logName={type=text, fields={keyword={ignore_above=256, type=keyword}}}, bytes={type=text, fields={keyword={ignore_above=256, type=keyword}}}, status code={type=text, fields={keyword={ignore_above=256, type=keyword}}}, time={type=text, fields={keyword={ignore_above=256, type=keyword}}}, t_state={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tq={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tr={type=text, fields={keyword={ignore_above=256, type=keyword}}}}}]",
"caused_by" : {
"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [mytype : {properties={date={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tt={type=text, fields={keyword={ignore_above=256, type=keyword}}}, request={type=text, fields={keyword={ignore_above=256, type=keyword}}}, actconn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, ps={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tw={type=text, fields={keyword={ignore_above=256, type=keyword}}}, srv_conn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, f_end={type=text, fields={keyword={ignore_above=256, type=keyword}}}, pid={type=text, fields={keyword={ignore_above=256, type=keyword}}}, hostname={type=text, fields={keyword={ignore_above=256, type=keyword}}}, beconn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, host={type=text, fields={keyword={ignore_above=256, type=keyword}}}, req_headers={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tag={type=text, fields={keyword={ignore_above=256, type=keyword}}}, b_server={type=text, fields={keyword={ignore_above=256, type=keyword}}}, feconn={type=text, fields={keyword={ignore_above=256, type=keyword}}}, privateip={type=text, fields={keyword={ignore_above=256, type=keyword}}}, srv_queue={type=text, fields={keyword={ignore_above=256, type=keyword}}}, res_cookie={type=text, fields={keyword={ignore_above=256, type=keyword}}}, req_cookie={type=text, fields={keyword={ignore_above=256, type=keyword}}}, c_ip={type=text, fields={keyword={ignore_above=256, type=keyword}}}, b_end={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tc={type=text, fields={keyword={ignore_above=256, type=keyword}}}, backend_queue={type=text, fields={keyword={ignore_above=256, type=keyword}}}, retries={type=text, fields={keyword={ignore_above=256, type=keyword}}}, @timestamp={type=date}, logName={type=text, fields={keyword={ignore_above=256, type=keyword}}}, bytes={type=text, fields={keyword={ignore_above=256, type=keyword}}}, status code={type=text, fields={keyword={ignore_above=256, type=keyword}}}, time={type=text, fields={keyword={ignore_above=256, type=keyword}}}, t_state={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tq={type=text, fields={keyword={ignore_above=256, type=keyword}}}, tr={type=text, fields={keyword={ignore_above=256, type=keyword}}}}}]"
}
},
"status" : 400
}