Moritz Onken

NAME

MooseX::Types::ElasticSearch - Useful types for ElasticSearch

VERSION

version 0.0.4

SYNOPSIS

 use MooseX::Types::ElasticSearch qw(:all);

TYPES

ES

This type matches against an Elasticsearch instance. It coerces from a Str, ArrayRef and HashRef.

If the string contains only the port number (e.g. ":9200"), then 127.0.0.1:9200 is assumed.

Location

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 }).

SearchType

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.

ESDateTime

ElasticSearch returns dates in the ISO8601 date format. This type coerces from Str to DateTime objects using DateTime::Format::ISO8601.

TODO

More types

Please don't hesitate and send other useful types in.

AUTHOR

Moritz Onken

COPYRIGHT AND LICENSE

This software is Copyright (c) 2014 by Moritz Onken.

This is free software, licensed under:

  The (three-clause) BSD License