NAME

Elastic::Model::TypeMap::ES - Type maps for ElasticSearch-specific types

VERSION

version 0.06

DESCRIPTION

Elastic::Model::TypeMap::ES provides mapping, inflation and deflation for ElasticSearch specific types.

TYPES

Elastic::Model::Types::Keyword

Attributes of type "Keyword" in Elastic::Model::Types are in/deflated via "Any" in Elastic::Model::TypeMap::Moose and are mapped as:

{
    type                         => 'string',
    index                        => 'not_analyzed',
    omit_norms                   => 1,
    omit_term_freq_and_positions => 1,
}

It is a suitable type to use for string attributes which should not be analyzed, and will not be used for scoring. Rather they are suitable to use as filters.

Elastic::Model::Types::UID

An Elastic::Model::UID is deflated into a hash ref and reinflated via "new_from_store()" in Elastic::Model::UID. It is mapped as:

{
    type        => 'object',
    dynamic     => 'strict',
    path        => 'just_name',
    properties  => {
        index   => {
            type                         => 'string',
            index                        => 'not_analyzed',
            index_name                   => 'uid.index',
            omit_norms                   => 1,
            omit_term_freq_and_positions => 1,
        },
        type => {
            type                         => 'string',
            index                        => 'not_analyzed',
            index_name                   => 'uid.type',
            omit_norms                   => 1,
            omit_term_freq_and_positions => 1,
        },
        id   => {
            type                         => 'string',
            index                        => 'not_analyzed',
            index_name                   => 'uid.id',
            omit_norms                   => 1,
            omit_term_freq_and_positions => 1,
        },
        routing   => {
            type                         => 'string',
            index                        => 'no',
            omit_norms                   => 1,
            omit_term_freq_and_positions => 1,
        },
    }
}

Elastic::Model::Types::GeoPoint

Attributes of type "GeoPoint" in Elastic::Model::Types are mapped as { type => 'geo_point' }.

Elastic::Model::Types::Binary

Attributes of type "Binary" in Elastic::Model::Types are deflated via "encode_base64" in MIME::Base64 and inflated via "decode_base_64" in MIME::Base64. They are mapped as { type => 'binary' }.

Elastic::Model::Types::Timestamp

Attributes of type "Timestamp" in Elastic::Model::Types are deflated to epoch milliseconds, and inflated to epoch seconds (with floating-point milliseconds). It is mapped as { type => 'date' }.

AUTHOR

Clinton Gormley <drtech@cpan.org>

COPYRIGHT AND LICENSE

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.