gpt4 book ai didi

elasticsearch - 删除 Elasticsearch 动态模板

转载 作者:行者123 更新时间:2023-12-02 22:58:38 25 4
gpt4 key购买 nike

我不小心将默认映射更改为

{
"template": "*",
"mappings": {
"_default_": {
"properties" : {
"message": {"type":"string", "index": "analyzed"}
},
"dynamic_templates": [
{
"my_template": {
"match_mapping_type": "string",
"mapping": {
"index": "not_analyzed"
}
}
}
]
}
}
}

现在每个新索引的所有字符串字段都为not_indexed。我想删除此动态模板,然后将所有内容更改回去。我的目标设置为not_indexed到某些字段。
感谢您的意见。

最佳答案

如果您使用感官/木假名,请使用...

DELETE _template/{template_name or id}

使用CURL ...
curl -X DELETE localhost:9200/_template/{template_name or id}

可以引用下面的链接

https://www.elastic.co/guide/en/elasticsearch/reference/6.2/indices-templates.html#delete

要在更正模板后重新索引数据,请使用
POST /_reindex
{
"source": {
"index": "old-index-name"
},
"dest": {
"index": "new-index-name"
}
}

关于elasticsearch - 删除 Elasticsearch 动态模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42181279/

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