Elasticsearch Reindex API

以 2.4.x 为例 说明 reindex 的基本用法

The reindex API is new and should still be considered experimental. The API may change in ways that are not backwards compatible

reindex API是新的,应该仍然被认为是实验性的。 API可能以不向后兼容的方式更改

The most basic form of _reindex just copies documents from one index to another. This will copy documents from the twitter index into the new_twitter index:

_reindex的最基本形式只是将文档从一个索引复制到另一个索引。这会将twitter索引中的文档复制到new_twitter索引中:

POST /_reindex
{
  "source": {
    "index": "twitter"
  },
  "dest": {
    "index": "new_twitter"
  }
}

That will return something like this:

{
  "took" : 147,
  "timed_out": false,
  "created": 120,
  "updated": 0,
  "batches": 1,
  "version_conflicts": 0,
  "failures" : [ ],
  "created": 12344
}

While Reindex is running you can fetch their status using the Task API:

GET /_tasks/?pretty&detailed=true&actions=*reindex

Any Reindex can be canceled using the Task Cancel API:

POST /_tasks/{task_id}/_cancel

The task_id can be found using the tasks API above.

具体参数设置 参考 https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-reindex.html

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,129评论 0 10
  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 13,140评论 0 13
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,398评论 0 23
  • 中国自古便是一个注重家教的国度,以儒家思想为核心的“家训”是中国传统文化的有机组成部分,在对氏族子弟成人、成才、修...
    淡云轻风阅读 6,857评论 0 3
  • 进入大学,我们刚脱离父母的掌控,不用每天呆在教室里听课,写作业,一坐就是一整天。相反的,告别了高中生活,我...
    安木学长阅读 3,315评论 0 2