Elastic::Model::Meta::Class::Model - A meta-class for Models
version 0.52
Holds static information about your model: namespaces and their types, and char_filters, tokenizers, filters and analyzers for analysis.
You shouldn't need to use this class directly. Everything you need should be accessible via Elastic::Model or Elastic::Model::Role::Model.
$bool = $meta->is_default($type => $name);
Returns true if $name is a $type (analyzer, tokenizer, filter, char_filter) available in Elasticsearch by default.
true
$name
$type
standard, simple, whitespace, stop, keyword, pattern, snowball, and the language analyzers: arabic, armenian, basque, brazilian, bulgarian, catalan, chinese, cjk, czech, danish, dutch, english, finnish, french, galician, german, greek, hindi, hungarian, indonesian, italian, latvian, norwegian, persian, portuguese, romanian, russian, spanish, swedish, thai, turkish
arabic
armenian
basque
brazilian
bulgarian
catalan
chinese
cjk
czech
danish
dutch
english
finnish
french
galician
german
greek
hindi
hungarian
indonesian
italian
latvian
norwegian
persian
portuguese
romanian
russian
spanish
swedish
thai
turkish
edge_ngram, keyword, letter, lowercase, ngram, path_hierarchy, pattern, standard, uax_url_email, whitespace
asciifolding, dictionary_decompounder, edge_ngram, elision, hyphenation_decompounder, icu_collation, icu_folding, icu_normalizer, kstem, length, lowercase, ngram, pattern_replace, phonetic, porterStem, reverse, shingle, snowball, standard, stop, synonym, trim, truncate, unique, word_delimiter
html_strip, mapping
$analysis = $meta->analysis_for_mappings($mappings)
Used to generate the analysis settings for an index, based on which analyzers are used in the mappings for all types in the index.
analysis
mappings
types
$new_class = $meta->wrapped_class_name($old_class);
Generates a semi-anonymous classname with the format Elastic::Model::__WRAPPED_::$n
Elastic::Model::__WRAPPED_::$n
\%namespaces = $meta->namespaces; \%namespace = $meta->namespace($name); $bool = $meta->has_namespace($name); @names = $meta->all_namespaces;
A hash ref containing all namespaces plus their configuration, eg:
{ myapp => { types => { user => 'MyApp::User' } } }
$index = $meta->unique_index
The name of the index where unique keys will be stored, which defaults to unique_key. A different value can be specified with has_unique_index.
unique_key
See Elastic::Manual::Attributes::Unique for more.
\%analyzers = $meta->analyzers; \%analyzer = $meta->analyzer($name); $bool = $meta->has_analyzer($name); @names = $meta->all_analyzers;
A hash ref containing all analyzers plus their configuration, eg:
{ my_analyzer => { type => 'custom', tokenizer => 'standard', filter => ['lower'] } }
\%tokenizers = $meta->tokenizers; \%tokenizer = $meta->tokenizer($name); $bool = $meta->has_tokenizer($name); @names = $meta->all_tokenizers;
A hash ref containing all tokenizers plus their configuration, eg:
{ my_tokenizer => { type => 'pattern', pattern => '\W' } }
\%filters = $meta->filters; \%filter = $meta->filter($name); $bool = $meta->has_filter($name); @names = $meta->all_filters;
A hash ref containing all filters plus their configuration, eg:
{ my_filter => { type => 'edge_ngram', min_gram => 1, max_gram => 20 } }
\%char_filters = $meta->char_filters; \%char_filter = $meta->char_filter($name); $bool = $meta->has_char_filter($name); @names = $meta->all_char_filters;
A hash ref containing all char_filters plus their configuration, eg:
{ my_char_filter => { type => 'mapping', mappings => ['ph=>f','qu=>q'] } }
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.