Elastic::Model::Alias - Administer aliases in Elasticsearch
version 0.51
$alias = $model->namespace('myapp')->alias; $alias = $model->namespace('myapp')->alias('alias_name'); $alias->to( 'index_1', 'index_2' ); $alias->to( 'index_1' => \%settings, index_2 => \%settings); $alias->add( 'index_1', 'index_2' ); $alias->add( 'index_1' => \%settings, index_2 => \%settings); $alias->remove( 'index_1', 'index_2' ); \%indices = $alias->aliased_to;
See also "SYNOPSIS" in Elastic::Model::Role::Index.
Elastic::Model::Alias objects are used to create and administer index aliases in an Elasticsearch cluster.
See Elastic::Model::Role::Index for more about usage. See Elastic::Manual::Scaling for more about how aliases can be used in your application.
$alias = $alias->to(@index_names); $alias = $alias->to( index_name => \%alias_settings, ... );
Creates or updates the alias "name" and sets it to point to the listed indices. If it already exists and points to indices not specified in @index_names, then those indices will be removed from the alias.
@index_names
You can delete an alias completely with:
$alias->to();
Aliases can have filters and routing values associated with an index, for instance:
$alias->to( my_index => { routing => 'client_one', filterb => { client => 'client_one'} } );
See Elastic::Manual::Scaling for more about these options.
$alias = $alias->add(@index_names); $alias = $alias->add( index_name => \%alias_settings, ... );
"add()" works in the same way as "to()" except that indices are only added - existing indices are not removed.
$alias = $alias->remove(@index_names);
The listed index names are removed from alias "name".
$indices = $alias->aliased_to();
Returns a hashref of the current settings for an alias, suitable for passing to "to()". The keys are index names, and the values are the alias settings.
Attributes imported from Elastic::Model::Role::Index
Methods imported from Elastic::Model::Role::Index
Elastic::Model::Role::Index
Elastic::Model::Index
Elastic::Model::Namespace
Elastic::Manual::Scaling
Clinton Gormley <drtech@cpan.org>
This software is copyright (c) 2015 by Clinton Gormley.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Elastic::Model, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Elastic::Model
CPAN shell
perl -MCPAN -e shell install Elastic::Model
For more information on module installation, please visit the detailed CPAN module installation guide.