繁体   English   中英

Elasticsearch-不使用Logstash或滚动API重新索引数据的最佳方法是什么?

[英]Elasticsearch - What is the best way to reindex my data without using Logstash or the scroll api?

我正在使用Elasticsearch版本1.7.5。 在我可以升级到2.x版(甚至是5.x版)之前,我需要重新索引五个大索引,以使其符合2.x标准。

不幸的是,由于这个问题 ,Logstash(和滚动api)无法为我的数据重新编制索引。


我的问题:

  • 不使用Logstash或滚动API重新索引数据的最佳方法是什么?
    • 如果可能的话,我宁愿使用Nest。

如果您以Elasticsearch 5.0+为目标,则可以使用reindex API将数据从远程Elasticsearch集群(1.7.5集群)重新索引到Elasticsearch 5.0+。

NEST 5.x将重新索引API公开为ReindexOnServer()方法

client.ReindexOnServer(r => r
    .Source(s => s
        .Remote(sr => sr
            // URI to 1.7.5 cluster
            .Host(new Uri("http://localhost:9201"))
        )
        .Index("entries")
    )
    .Destination(d => d
        .Index("entries")
    )
    .WaitForCompletion(true)
);

WaitForCompletion确定调用是否应等待重新索引完成。 如果为假,则可以使用任务API使用响应上的Task属性检查操作状态

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM