Elastic::Model::Types - MooseX::Types for general and internal use
version 0.02
use Elastic::Model::Types qw(GeoPoint); has 'point' => ( is => 'ro', isa => GeoPoint, coerce => 1 );
Elastic::Model::Types define a number of MooseX::Types, some for internal use and some which will be useful generally.
use Elastic::Model::Types qw(Binary); has 'binary_field' => ( is => 'ro', isa => Binary );
Inherits from the Defined type. Is automatically Base64 encoded/decoded.
Defined
use Elastic::Model::Types qw(GeoPoint); has 'point' => ( is => 'ro', isa => GeoPoint, coerce => 1, );
GeoPoint is a hashref with two keys:
GeoPoint
lon: a Number between -180 and 180
lon
Number
lat: a Number between -90 and 90
lat
It can be coerced from an ArrayRef with [$lon,$lat] and from a Str with "$lat,$lon".
ArrayRef
[$lon,$lat]
Str
"$lat,$lon"
use Elastic::Model::Types qw(Timestamp); has 'timestamp' => ( is => 'ro', isa => Timestamp );
A Timestamp is a Num which holds floating epoch seconds, with milliseconds as decimal places. It is automatically mapped as a date field in ElasticSearch.
Timestamp
Num
date
Clinton Gormley <drtech@cpan.org>
This software is copyright (c) 2012 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.