Elastic::Model::TypeMap::Moose - Type maps for core Moose types
version 0.28
Elastic::Model::TypeMap::Moose provides mapping, inflation and deflation for the core Moose::Util::TypeConstraints and MooseX::Type::Moose types. It is loaded automatically by Elastic::Model::TypeMap::Default.
Definitions are inherited from parent type constraints, so a specific mapping may be provided for "Int" but the deflation and inflation is handled by "Any".
No deflation or inflation is attempted - the value is passed unaltered. If it is not a value that JSON::XS can handle (eg a blessed value) then deflation will fail.
It is mapped as: { type => 'object', enabled => 0 }.
{ type => 'object', enabled => 0 }
Mapping and in/deflation via "Any".
In/deflation via "Any". It is mapped as:
{ type => 'boolean', null_value => 0 }
An undef value is stored as a JSON null. The mapping and in/deflation depend on the content type, eg Maybe[Int]. A Maybe without a content type is mapped and in/deflated via "Any". Maybe[Bool] is special cased to be mapped as:
null
Maybe[Int]
Maybe
Maybe[Bool]
{ type => 'boolean' }
See "BOOLEAN FIELDS" in Elastic::Manual::Attributes for an explanation.
Mapped as { type => 'string', index => 'not_analyzed' }. In/deflation via "Any".
{ type => 'string', index => 'not_analyzed' }
Mapped as { type => 'string' }. In/deflation via "Any".
{ type => 'string' }
Values are passed through without inflation/deflation. Mapped as:
{ type => 'string', index => 'not_analyzed', omit_norms => 1, omit_term_freq_and_positions => 1 }
Mapped as { type => 'float' }. In/deflation via "Any".
{ type => 'float' }
Mapped as { type => 'long' }. In/deflation via "Any".
{ type => 'long' }
No delator, inflator or mapping provided.
The scalar value is dereferenced on deflation, and converted back to a scalar ref on inflation. The mapping depends on the content type, eg ScalarRef[Int]. A ScalarRef without a content type is mapped via "Any".
ScalarRef[Int]
ScalarRef
An array ref is preserved on inflation/deflation. The mapping depends on the content type, eg ArrayRef[Int]. An ArrayRef without a content type is mapped and in/deflated via "Any". For array refs with elements of different types, see "Tuple" in Elastic::Model::TypeMap::Structured.
ArrayRef[Int]
ArrayRef
A hash ref is preserved on inflation/deflation. It is not advisable to allow arbitrary key names in indexed hashes, as you could end up generating many (and conflicting) field mappings. For this reason, HashRefs are mapped as { type => 'object', enabled => 0 }. In/deflation depends on the content type (eg HashRef[Int]). A HashRef without a content type is in/deflated via "Any".
HashRef[Int
HashRef
If you need a hashref which is indexed, then rather use either an object or "Dict" in Elastic::Model::TypeMap::Structure.
No delator or inflator is provided. It is mapped as: { type => 'string', index => 'no' }.
{ type => 'string', index => 'no' }
Clinton Gormley <drtech@cpan.org>
This software is copyright (c) 2014 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.