How to copy some ElasticSearch data to a new index

后端 未结 6 2114
渐次进展
渐次进展 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条回答
  •  旧时难觅i
    2020-12-23 10:06

    Check out knapsack: https://github.com/jprante/elasticsearch-knapsack

    Once you have the plugin installed and working, you could export part of your index via query. For example:

    curl -XPOST 'localhost:9200/test/test/_export' -d '{
    "query" : {
        "match" : {
            "myfield" : "myvalue"
        }
    },
    "fields" : [ "_parent", "_source" ]
    }'
    

    This will create a tarball with only your query results, which you can then import into another index.

提交回复
热议问题