MooseX::Types::ElasticSearch - Useful types for ElasticSearch
version 0.0.4
use MooseX::Types::ElasticSearch qw(:all);
This type matches against an Elasticsearch instance. It coerces from a Str, ArrayRef and HashRef.
Str
ArrayRef
HashRef
If the string contains only the port number (e.g. ":9200"), then 127.0.0.1:9200 is assumed.
":9200"
127.0.0.1:9200
ElasticSearch expects values for geo coordinates (geo_point) as an ArrayRef of longitude and latitude. This type coerces from Str ("lat,lon") and HashRef ({ lat => 41.12, lon => -71.34 }).
geo_point
"lat,lon"
{ lat => 41.12, lon => -71.34 }
Enum type. Valid values are: query_and_fetch query_then_fetch dfs_query_and_fetch dfs_query_then_fetch scan count. The now deprecated QueryType is also still available.
Enum
query_and_fetch query_then_fetch dfs_query_and_fetch dfs_query_then_fetch scan count
QueryType
ElasticSearch returns dates in the ISO8601 date format. This type coerces from Str to DateTime objects using DateTime::Format::ISO8601.
More types
Please don't hesitate and send other useful types in.
Moritz Onken
This software is Copyright (c) 2014 by Moritz Onken.
This is free software, licensed under:
The (three-clause) BSD License
To install MooseX::Types::ElasticSearch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Types::ElasticSearch
CPAN shell
perl -MCPAN -e shell install MooseX::Types::ElasticSearch
For more information on module installation, please visit the detailed CPAN module installation guide.