gpt4 book ai didi

ElasticSearch 更新多字段映射

转载 作者:行者123 更新时间:2023-12-04 05:58:49 26 4
gpt4 key购买 nike

我有一个字段的现有映射,我想将其更改为多字段。

现有的映射是

{
"my_index": {
"mappings": {
"my_type": {
"properties": {
"author": {
"type": "string"
},
"isbn": {
"type": "string",
"analyzer": "standard",
"fields": {
"ngram": {
"type": "string",
"search_analyzer": "keyword"
}
}
},
"title": {
"type": "string",
"analyzer": "english",
"fields": {
"std": {
"type": "string",
"analyzer": "standard"
}
}
}
}
}
}
}
}

基于 documentation ,我应该能够通过执行以下命令将“作者”更改为多字段
PUT /my_index
{
"mappings": {
"my_type": {
"properties": {
"author":
{
"type": "multi-field",
"fields": {
"ngram": {
"type": "string",
"indexanalyzer": "ngram_analyzer",
"search_analyzer": "keyword"
},
"name" : {
"type": "string"
}
}
}
}
}
}
}

但相反,我收到以下错误:
{
"error": "IndexAlreadyExistsException[[my_index] already exists]",
"status": 400
}

我错过了一些非常明显的东西吗?

最佳答案

而不是 PUT 到/my_index 做:

POST /my_index/_mapping

关于ElasticSearch 更新多字段映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27527331/

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