Elasticsearch::Util::API::Path - A utility class for converting path templates into real paths
version 0.72
This module converts path templates in Elasticsearch::Role::API such as /{index}/{type}/{id} into real paths such as /my_index/my_type/123.
/{index}/{type}/{id}
/my_index/my_type/123
path_init()
use Elasticsearch::Util::API::Path qw(path_init); $handler = path_init($template); $path = $handler->(\%params);
The path_init() sub accepts a path template and returns an anonymous sub which converts \%params into a real path, removing the keys that it has used from %params, eg:
\%params
%params
$handler = path_init('/{indices}/_search'); $params = { index => ['foo','bar'], size => 10 }; $path = $handler->($params);
Would result in:
$path: '/foo,bar/_search'; $params: { size => 10 };
Clinton Gormley <drtech@cpan.org>
This software is Copyright (c) 2013 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install Elasticsearch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Elasticsearch
CPAN shell
perl -MCPAN -e shell install Elasticsearch
For more information on module installation, please visit the detailed CPAN module installation guide.