【发布时间】:2017-08-04 22:41:37
【问题描述】:
我对弹性搜索完全陌生,想将一种现有的字段数据类型从“字符串”类型更新为“文本”类型。我试过但最终得到了这个异常:"No handler for type [text] declared on field [Name]"
任何建议,我的 elasticsearch 版本 -
{
"name" : "Tej",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "raiQbq0ySUioBScsptsTzQ",
"version" : {
"number" : "2.4.4",
"build_hash" : "fcbb46dfd45562a9cf00c604b30849a6dec6b017",
"build_timestamp" : "2017-01-03T11:33:16Z",
"build_snapshot" : false,
"lucene_version" : "5.5.2"
},
"tagline" : "You Know, for Search"
}
索引映射细节 -
{"customer":{"mappings":{"external":{"properties":{"Name":{"type":"string"},"age":{"type":"long"},"doc":{"properties":{"age":{"type":"long"},"name":{"type":"string"}}},"name":{"type":"string"}}}}}}
根据文档 - 我使用以下命令更新现有数据类型
`curl -i -X PUT \
-H "Content-Type:application/json" \
-d \
'{
"external" : {
"properties" : {
"Name" : {"type" : "text"}
}
}
}
' \
'http://10.200.14.15:9200/customer/_mapping/external'`
回复
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "No handler for type [text] declared on field [Name]"
}
],
"type": "mapper_parsing_exception",
"reason": "No handler for type [text] declared on field [Name]"
},
"status": 400
}
【问题讨论】:
-
你的弹性搜索版本是多少?
-
@Teja R 你想达到什么目的?你知道
type: string和type: text之间的区别吗?否则我建议你阅读this。希望这会有所帮助!
标签: curl elasticsearch logstash