gpt4 book ai didi

search - 映射器解析异常根映射定义具有不受支持的参数

转载 作者:行者123 更新时间:2023-12-03 01:48:42 25 4
gpt4 key购买 nike

我正在尝试成功创建具有自动完成支持的索引,但是无法向其中添加数据。
请对此提供帮助,我在过去48小时内一直停留在此错误上。

请查看附件中的设置

放入http://localhost:9200/my_index/_mapping/users/
输入:

{
"userId": "2",
"userFirstName": "m4",
"userLastName": "m4",
"userMobile": "4047534441",
"userEmail": "test@gmail.com",
"userSpecialization": "1:3",
"userCityId": "6",
"userCityName":"Hyderabad"
}

外出:
{ "error": { "root_cause": [ { "type": "mapper_parsing_exception", "reason": "Root mapping definition has unsupported parameters: [userId : 2] [userFirstName : m4] [userLastName : m4] [userMobile : 40475341] [userEmail : test@gmail.com] [userSpecialization : 1:3] [userCityId : 6] [userCityName : Hyderabad]" } ], "type": "mapper_parsing_exception", "reason": "Root mapping definition has unsupported parameters: [userId : 2] [userFirstName : m4] [userLastName : m4] [userMobile : 40475341] [userEmail : test@gmail.com] [userSpecialization : 1:3] [userCityId : 6] [userCityName : Hyderabad]" }, "status": 400 }

设定:
{
"my_index": {
"aliases": {

},
"mappings": {
"practices": {
"_all": {
"analyzer": "nGram_analyzer",
"search_analyzer": "whitespace_analyzer"
},
"properties": {
"practiceCity": {
"type": "string",
"index":"analyzed"
},
"practiceId": {
"type": "long",
"index":"not_analyzed"
},
"practiceName": {
"type": "string",
"boost": 10,
"index":"analyzed"
},
"practicePhone": {
"type": "long",
"boost": 10,
"index":"analyzed"
},
"practiceService": {
"type": "string",
"boost": 5,
"index":"not_analyzed"
}
}
},
"users": {
"_all": {
"analyzer": "nGram_analyzer",
"search_analyzer": "whitespace_analyzer"
},
"properties": {
"userCityId": {
"type": "long",
"index":"not_analyzed"
},
"userCityName": {
"type": "string",
"index":"not_analyzed"
},
"userEmail": {
"type": "string",
"index":"analyzed"
},
"userFirstName": {
"type": "string",
"boost": 10,
"index":"analyzed"
},
"userId": {
"type": "long"
},
"userLastName": {
"type": "string",
"boost": 10,
"index":"not_analyzed"
},
"userMobile": {
"type": "string",
"index":"analyzed"
},
"userSpecialization": {
"type": "string",
"boost": 5,
"index":"not_analyzed"
}
}
}
},
"settings": {
"index": {
"analysis": {
"filter": {
"nGram_filter": {
"max_gram": "20",
"type": "nGram",
"min_gram": "3",
"token_chars": [
"letter",
"digit",
"punctuation",
"symbol"
]
}
},
"analyzer": {
"nGram_analyzer": {
"type": "custom",
"filter": [
"lowercase",
"asciifolding",
"nGram_filter"
],
"tokenizer": "whitespace"
},
"whitespace_analyzer": {
"type": "custom",
"filter": [
"lowercase",
"asciifolding"
],
"tokenizer": "whitespace"
}
}
},
"number_of_replicas": "1",
"number_of_shards": "5"
}
}
}
}

最佳答案

您用来索引新文档的URL是错误的。 _mapping端点用于管理映射类型,而不用于索引文档。

改用这个,它将起作用。

PUT http://localhost:9200/my_index/users/2
{
"userId": "2",
"userFirstName": "m4",
"userLastName": "m4",
"userMobile": "4047534441",
"userEmail": "test@gmail.com",
"userSpecialization": "1:3",
"userCityId": "6",
"userCityName":"Hyderabad"
}

关于search - 映射器解析异常根映射定义具有不受支持的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42056502/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com