ElasticSearch - How to merge indexes into one index?

前端 未结 2 983
小蘑菇
小蘑菇 2021-01-31 00:06

My cluster has an index for each day since a few months ago, 5 shards each index (the default), and I can\'t run queries on the whole cluster because there are too many shards (

2条回答
  •  孤独总比滥情好
    2021-01-31 00:34

    You can use the reindex api.

    POST _reindex
    {
     "conflicts": "proceed",
     "source": {
       "index": ["twitter", "blog"],
       "type": ["tweet", "post"]
      },
      "dest": {
      "index": "all_together"
     }
    }
    

提交回复
热议问题