How to copy some ElasticSearch data to a new index

后端 未结 6 2111
渐次进展
渐次进展 2020-12-23 09:39

Let\'s say I have movie data in my ElasticSearch and I created them like this:

curl -XPUT \"http://192.168.0.2:9200/movies/movie/1\" -d\'
{
    \"title\": \"         


        
6条回答
  •  自闭症患者
    2020-12-23 09:55

    Since ElasticSearch 2.3 you can now use the built in _reindex API

    for example:

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

    Or only a specific part by adding a filter/query

    POST /_reindex
    {
      "source": {
        "index": "twitter",
        "query": {
          "term": {
            "user": "kimchy"
          }
        }
      },
      "dest": {
        "index": "new_twitter"
      }
    }
    

    Read more: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html

提交回复
热议问题