Reputation: 1140
I need to change the number of shards in my index. The index is quite big and i may have to change the configuration 10-15 times for testing purposes before i'm satisfied with the result. is there a tool offering out of the box this kind of functionality? or what's the easiest way of accomplishing this?
Upvotes: 4
Views: 4478
Reputation: 14429
Both the Perl and Ruby clients directly support reindexing.
In Perl, you'd do:
my $source = $es->scrolled_search(
index => 'old_index',
search_type => 'scan',
scroll => '5m',
version => 1
);
$es->reindex(
source => $source,
dest_index => 'new_index'
);
Find more information in the post by Clinton Gormley.
In Ruby, you'd do:
Tire.index('old').reindex 'new', settings: { number_of_shards: 3 }
Find more information in the relevant Tire commit.
Upvotes: 7