gpt4 book ai didi

elasticsearch - 如何更改现有索引中一个字段的映射? Elasticsearch

转载 作者:行者123 更新时间:2023-12-02 23:29:19 24 4
gpt4 key购买 nike

我有映射索引:

GET /warhammer/_mapping

给我:
{
"warhammer": {
"mappings": {
"logs": {
"properties": {
"@timestamp": {
"type": "date",
"format": "dateOptionalTime"
},
"@version": {
"type": "string"
},
"HostName": {
"type": "string"
},
"boosters": {
"type": "long"
},
"device_model": {
"type": "string"
},
"build_type": {
"type": "string"
}....
}

我需要将字段 device_model的映射更改为 not_analysed!
我试过了:
PUT /warhammer/_mapping
{
"device_model": { "type": "string",
"fields": { "raw":
{ "type": "string", "index": "not_analyzed" } } }
}

还有这个:
PUT /warhammer/_mapping
{
"device_model": {
"type": "string",
"fields":
{ "raw":
{ "type": "string",
"index": "not_analyzed" }
}
}
}

但这给了我:
  {
"error": "ActionRequestValidationException[Validation Failed: 1: mapping type is missing;]",
"status": 400
}

我究竟做错了什么?请帮忙!

最佳答案

PUT /warhammer/_mapping/logs
{
"properties": {
"device_model": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}

关于elasticsearch - 如何更改现有索引中一个字段的映射? Elasticsearch ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38439908/

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