我需要更改索引中的分片数量。索引很大,为了达到测试目的,我可能不得不将配置更改10-15次才能满意。是否有开箱即用的工具提供这种功能?或最简单的方法是做到这一点?
无论是Perl的和Ruby客户直接支持重建索引。
在Perl中,您可以执行以下操作:
my $source = $es->scrolled_search( index => 'old_index', search_type => 'scan', scroll => '5m', version => 1 ); $es->reindex( source => $source, dest_index => 'new_index' );
在Clinton Gormley的帖子中查找更多信息。
在Ruby中,您可以执行以下操作:
Tire.index('old').reindex 'new', settings: { number_of_shards: 3 }
在相关的 Tyre 提交中找到更多信息。