0

是否可以为重新索引设置特定的嵌套字段?根据文档https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-filter-source,选定的字段是数组。

    POST _reindex
    {
      "source": {
        "index": "twitter",
        "_source": ["user", "_doc"]
      },
      "dest": {
        "index": "new_twitter"
      }
    }

例如,我们只需要重新索引用户的嵌套字段,如“姓名”和“生日”:怎么做?我们需要这样的东西:

    POST _reindex
    {
      "source": {
        "index": "twitter",
        "_source": { "user": ["name", "birthdate"], "_doc"]
      },
      "dest": {
        "index": "new_twitter"
      }
    }
4

1 回答 1

2
POST _reindex 
{
      "source": {
        "index": "twitter",
        "_source": [ "user.name", "user. birthdate", "_doc"]
      },
      "dest": {
        "index": "twitter_new"
      }
    }
}

您需要使用.来引用它们。

于 2020-06-22T08:38:24.967 回答