Created
June 17, 2014 15:08
-
-
Save phochste/9d4f2fea85b41de7f563 to your computer and use it in GitHub Desktop.
Catmandu ElasticSearch error handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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