ElasticSearchX-Model

 view release on metacpan or  search on metacpan

lib/ElasticSearchX/Model/Document/Set.pm  view on Meta::CPAN


sub add_sort { push( @{ $_[0]->sort }, $_[1] ); return $_[0]; }

sub add_field { push( @{ $_[0]->fields }, $_[1] ); return $_[0]; }

has search_type =>
    ( isa => QueryType, is => 'rw', traits => [qw(ChainedClone)] );

sub query_type { shift->search_type(@_) }

has mixin => ( is => 'ro', isa => 'HashRef', traits => [qw(ChainedClone)] );

has inflate =>
    ( isa => 'Bool', default => 1, is => 'rw', traits => [qw(ChainedClone)] );

sub raw {
    shift->inflate(0);
}

has _refresh =>
    ( isa => 'Bool', default => 0, is => 'rw', traits => [qw(ChainedClone)] );

lib/ElasticSearchX/Model/Document/Trait/Attribute.pm  view on Meta::CPAN

use ElasticSearchX::Model::Document::Types qw(:all);
use MooseX::Types::Moose qw(ArrayRef);

has index   => ( is => 'ro' );
has boost   => ( is => 'ro', isa => 'Num' );
has store   => ( is => 'ro', isa => 'Str', default => 'yes' );
has type    => ( is => 'ro', isa => 'Str', default => 'string' );
has parent  => ( is => 'ro', isa => 'Bool', default => 0 );
has dynamic => ( is => 'ro', isa => 'Bool', default => 0 );
has analyzer =>
    ( is => 'ro', isa => ArrayRef, coerce => 1, default => sub { [] } );
has not_analyzed   => ( is => 'ro', isa => 'Bool', default => 1 );
has term_vector    => ( is => 'ro', isa => 'Str' );
has include_in_all => ( is => 'ro', isa => 'Bool', default => 1 );
has source_only    => ( is => 'ro', isa => 'Bool', default => 0 );
has include_in_root   => ( is => 'ro', isa => 'Bool' );
has include_in_parent => ( is => 'ro', isa => 'Bool' );
has property          => ( is => 'ro', isa => 'Bool', default => 1 );
has query_property    => ( is => 'ro', isa => 'Bool', default => 0 );
has field_name =>
    ( is => 'ro', isa => 'Str', lazy => 1, default => sub { shift->name } );

t/document/get_data.t  view on Meta::CPAN

);

MyModel::MyType->meta->make_immutable;

package MyModel::MyClass;
use Moose;
use ElasticSearchX::Model::Document;
use ElasticSearchX::Model::Document::Types qw(:all);
use MooseX::Types::Moose qw(:all);

has module => ( is => 'ro', isa => ArrayRef [ Type ['MyType'] ] );
has hash => ( is => 'ro', isa => 'HashRef' );
has hash_dynamic => ( is => 'ro', isa         => 'HashRef', dynamic => 1 );
has author       => ( is => 'ro' );
has extra        => ( is => 'ro', source_only => 1,         dynamic => 1 );
has [qw(bool1 bool2)] => ( is => 'ro', isa => 'Bool' );
has array => ( is => 'ro', isa => 'ArrayRef[Num]', dynamic => 1 );

MyModel::MyClass->meta->make_immutable;

package MyModel;
use Moose;
use ElasticSearchX::Model;

index static  => ( dynamic => 0 );
index dynamic => ( dynamic => 1 );



( run in 0.326 second using v1.01-cache-2.11-cpan-00829025b61 )