This is no longer maintained. Please see the fork: https://github.com/itnode/DBIx-Class-Elasticsearch
$ git submodule add git@github.com:ShepFc3/ElasticDBIx.git lib/ElasticDBIx
$ git submodule init
$ git submodule update
edit file to reflect your elastic search settings
use lib '/base/dir/lib';
you only need this if lib is already in your path
use base qw(ElasticDBIx::Schema DBIx::Class::Schema);
you need this if you want to use index_all
Create a new class that includes ElasticDBIx::Result and DBIx::Class::Core
package MyApp::ElasticResult;
use strict;
use warnings;
use base qw(ElasticDBIx::Result DBIx::Class::Core);
1;
use base qw(MyApp::ElasticResult);
__PACKAGE__->add_columns("id", { searchable => 1 });
package MyApp::ElasticResultSet;
use strict;
use warnings;
use base qw(ElasticDBIx::ResultSet DBIx::Class::ResultSet);
1;
use base qw(MyApp::ElasticResultSet);
use this to be able to batch_index a specific resultset
neccessary when using ElasticDBIx::Schema
$schema->index_all;
my $result = $schema->resultset('Artist')->find(1);
$result->index();
$schema->resultset('Artist')->batch_index;