更新映射不适用于我的索引(elasticsearch 1.4)
Update mapping not working on my index (elasticsearch 1.4)
当我尝试更新我的索引,并添加一个从方法 copy_to 创建的新字段(参见 http://pastebin.com/T7GcHSXj )时,我收到这个我不明白的错误:
"error":"MapperParsingException[Root type mapping not empty after
parsing! Remaining fields: [mappings :
{tInfoclient={properties={Client={properties={d_naiss_cli={type=string,
copy_to=full_info}, pr_cli_20={type=string, copy_to=full_info},
nom_cli_20={type=string, copy_to=full_info}, full_info={type=string},
dc_cli={format=dateOptionalTime, type=date},
no_coEmprunteur={type=string}, cmpl_voie_cli={type=string},
loc_cli={type=string}, no_tel_cli={type=string},
no_ctrat={type=string}, no_tel_empcli={type=string},
voie_cli={type=string}, c_post_cli={type=string},
c_qual={type=string}, ad_e_mail={type=string}, no_telp={type=string},
ptel_empcli={type=string}}}}}}]]","status":400}
我关注了网站上的文档,但没有任何线索:
https://www.elastic.co/guide/en/elasticsearch/reference/1.4/indices-put-mapping.html
https://www.elastic.co/guide/en/elasticsearch/guide/1.x/custom-all.html
更新映射类型时,您需要删除 mappings
部分和类型名称,因为它们已在 URL:
中指定
curl -XPUT 'http://maprvm:9200/maprdb/_mapping/tInfoclient' -d '{
"properties": {
"Client": {
"properties": {
"d_naiss_cli": {
"type": "string",
"copy_to": "full_info"
},
"pr_cli_20": {
"type": "string",
"copy_to": "full_info"
},
"nom_cli_20": {
"type": "string",
"copy_to": "full_info"
},
"full_info": {
"type": "string"
},
"dc_cli": {
"format": "dateOptionalTime",
"type": "date"
},
"no_coEmprunteur": {
"type": "string"
},
"cmpl_voie_cli": {
"type": "string"
},
"loc_cli": {
"type": "string"
},
"no_tel_cli": {
"type": "string"
},
"no_ctrat": {
"type": "string"
},
"no_tel_empcli": {
"type": "string"
},
"voie_cli": {
"type": "string"
},
"c_post_cli": {
"type": "string"
},
"c_qual": {
"type": "string"
},
"ad_e_mail": {
"type": "string"
},
"no_telp": {
"type": "string"
},
"ptel_empcli": {
"type": "string"
}
}
}
}
}'
当我尝试更新我的索引,并添加一个从方法 copy_to 创建的新字段(参见 http://pastebin.com/T7GcHSXj )时,我收到这个我不明白的错误:
"error":"MapperParsingException[Root type mapping not empty after parsing! Remaining fields: [mappings : {tInfoclient={properties={Client={properties={d_naiss_cli={type=string, copy_to=full_info}, pr_cli_20={type=string, copy_to=full_info}, nom_cli_20={type=string, copy_to=full_info}, full_info={type=string}, dc_cli={format=dateOptionalTime, type=date}, no_coEmprunteur={type=string}, cmpl_voie_cli={type=string}, loc_cli={type=string}, no_tel_cli={type=string}, no_ctrat={type=string}, no_tel_empcli={type=string}, voie_cli={type=string}, c_post_cli={type=string}, c_qual={type=string}, ad_e_mail={type=string}, no_telp={type=string}, ptel_empcli={type=string}}}}}}]]","status":400}
我关注了网站上的文档,但没有任何线索: https://www.elastic.co/guide/en/elasticsearch/reference/1.4/indices-put-mapping.html https://www.elastic.co/guide/en/elasticsearch/guide/1.x/custom-all.html
更新映射类型时,您需要删除 mappings
部分和类型名称,因为它们已在 URL:
curl -XPUT 'http://maprvm:9200/maprdb/_mapping/tInfoclient' -d '{
"properties": {
"Client": {
"properties": {
"d_naiss_cli": {
"type": "string",
"copy_to": "full_info"
},
"pr_cli_20": {
"type": "string",
"copy_to": "full_info"
},
"nom_cli_20": {
"type": "string",
"copy_to": "full_info"
},
"full_info": {
"type": "string"
},
"dc_cli": {
"format": "dateOptionalTime",
"type": "date"
},
"no_coEmprunteur": {
"type": "string"
},
"cmpl_voie_cli": {
"type": "string"
},
"loc_cli": {
"type": "string"
},
"no_tel_cli": {
"type": "string"
},
"no_ctrat": {
"type": "string"
},
"no_tel_empcli": {
"type": "string"
},
"voie_cli": {
"type": "string"
},
"c_post_cli": {
"type": "string"
},
"c_qual": {
"type": "string"
},
"ad_e_mail": {
"type": "string"
},
"no_telp": {
"type": "string"
},
"ptel_empcli": {
"type": "string"
}
}
}
}
}'