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是新的,應(yīng)該仍然被認為是實驗性的。 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.

具體參數(shù)設(shè)置 參考 https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-reindex.html

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,854評論 0 10
  • pyspark.sql模塊 模塊上下文 Spark SQL和DataFrames的重要類: pyspark.sql...
    mpro閱讀 9,914評論 0 13
  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,086評論 0 23
  • 中國自古便是一個注重家教的國度,以儒家思想為核心的“家訓”是中國傳統(tǒng)文化的有機組成部分,在對氏族子弟成人、成才、修...
    淡云輕風閱讀 2,569評論 0 3
  • 進入大學,我們剛脫離父母的掌控,不用每天呆在教室里聽課,寫作業(yè),一坐就是一整天。相反的,告別了高中生活,我...
    安木學長閱讀 526評論 0 2

友情鏈接更多精彩內(nèi)容