![](/img/trans.png)
[英]Is there a way of sending data directly to elasticsearch without using filebeats and logstash?
[英]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)无法为我的数据重新编制索引。
我的问题:
如果您以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.