From be2f8b00b86409487b0d603edaab5f71db92d9d1 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 13 Nov 2010 18:53:12 +0100 Subject: [PATCH] riak_search_kv_hook --- koha/koha2riak-search.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/koha/koha2riak-search.pl b/koha/koha2riak-search.pl index 8035135..ee43900 100755 --- a/koha/koha2riak-search.pl +++ b/koha/koha2riak-search.pl @@ -16,7 +16,11 @@ biblio my $dbh = DBI->connect($dbi,"","") || die $DBI::errstr; my $riak = Net::Riak->new(host => $riak_url ); -#my $marcxml_bucket = $riak->bucket( 'koha.marcxml' ); +my $xml_bucket = $riak->bucket( 'koha.marcxml' ); +$xml_bucket->set_properties({ + precommit => [ { mod => 'riak_search_kv_hook', fun => 'precommit' } ], +}); + foreach my $table ( @tables ) { @@ -27,6 +31,9 @@ foreach my $table ( @tables ) { print "import ", $sth->rows, " rows from $table pk:",dump( @pk ),"...\n"; my $bucket = $riak->bucket( 'koha.' . $table ); + $bucket->set_properties({ + precommit => [ { mod => 'riak_search_kv_hook', fun => 'precommit' } ], + }); while (my $row = $sth->fetchrow_hashref() ) { -- 2.20.1