Skip to content

Instantly share code, notes, and snippets.

@phochste
Created June 17, 2014 15:08
Show Gist options
  • Save phochste/9d4f2fea85b41de7f563 to your computer and use it in GitHub Desktop.
Save phochste/9d4f2fea85b41de7f563 to your computer and use it in GitHub Desktop.
Catmandu ElasticSearch error handler
use Catmandu;
use Data::Dumper;
my $importer = Catmandu->importer('Mock');
# Create a store with a vey strict schema that always produces errors ...
my $store = Catmandu->store('ElasticSearch',
index_name => 'test2',
bags => { data => {
on_error => sub {
warn Dumper(\@_);
}
}
},
index_mappings => {
data => {
dynamic => 'strict',
properties => {
title => { type => 'string'}
}
}
});
$store->add_many($importer);
$store->commit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment