clintongormley / Elastic-Model

Use ElasticSearch as a NoSQL database in Perl
9 stars 8 forks source link

omit_term_freq_and_positions' is not supported anymore #37

Closed kamunas closed 10 years ago

kamunas commented 10 years ago

For any reason elasticsearch rejects to create the index if object type is used.

ElasticsearchParseException['omit_term_freq_and_positions' is not supported anymore - use ['index_options' : 'DOCS_ONLY']  instead]; , called from sub Elasticsearch::Transport::__ANON__ at /root/perl5/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.2/Try/Tiny.pm line 76.
package MyApp::Related;

use Elastic::Doc;
use MooseX::Types::Moose qw(Str);

has 'field1' => (
    is    => 'rw',
    isa   => Str, 
);

no Moose::Util::TypeConstraints;
no Elastic::Model;

1;

package MyApp::Parent;

use Elastic::Doc;
use MyApp::Related;

has '_id' => (
    is    => 'ro',
    isa   => Num,
    index => 'not_analyzed',
);

has 'related_items' => (
    is      => 'rw',
    isa     => 'ArrayRef[MyApp::Related]',
    #default => sub {[]},
    #type    => 'object',
);

no Moose::Util::TypeConstraints;
no Elastic::Model;

1;
clintongormley commented 10 years ago

Hi @kamunas

Yes, Elastic::Model needs a major update. It is currently not compatible with ES v1.0. This update is planned but will take some time. I'll leave this ticket open until then.

clint

kamunas commented 10 years ago

Thanks for your efforts, Clint

clintongormley commented 10 years ago

Elastic::Model v0.50 is now compatible with Elasticsearch 1.x. See https://metacpan.org/pod/release/DRTECH/Elastic-Model-0.50/lib/Elastic/Manual/Delta.pod for upgrade details.