Elastic::Model::Types - MooseX::Types for general and internal use
version 0.52
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(Keyword); has 'status' => ( is => 'ro', isa => Keyword );
Keyword is a sub-type of Str. It is provided to make it easy to map string values which should not be analyzed (eg a status field rather than a comment_body field). See "Keyword" in Elastic::Model::TypeMap::ES.
Keyword
Str
status
comment_body
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]
"$lat,$lon"
use Elastic::Model::Types qw(Timestamp); has 'timestamp' => ( is => 'ro', isa => Timestamp );
A Timestamp is a Num which holds floating point epoch seconds, with milliseconds resolution. It is automatically mapped as a date field in Elasticsearch.
Timestamp
Num
date
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.