Elasticsearch 获取索引创建脚本

Elasticsearch get index creation script

我为具有不同映射的模型获得了一个索引

{
  "user_index": {
    "aliases": {
      "entities": {}
    },
    "mappings": {
      "user": {
        "dynamic": "strict",
        "_timestamp": {},
        "properties": {
          "firstName": {
            "type": "string",
            "index": "not_analyzed"
          },
          "id": {
            "type": "string",
            "index": "not_analyzed"        
          } ....

我想将 id 类型更改为 long

我如何获取并复制此索引创建脚本,并只需更改字段的 1 种类型,只需最少的工作,例如在 workbench 中获取 mysql 的导入脚本?

我想您可以使用所需的更改推送新索引映射,然后使用重新索引 api 从旧索引复制数据。