projects
/
NoSQL-toys.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
riak_search_kv_hook
[NoSQL-toys.git]
/
koha
/
koha2riak-search.pl
diff --git
a/koha/koha2riak-search.pl
b/koha/koha2riak-search.pl
index
8035135
..
ee43900
100755
(executable)
--- 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 $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 ) {
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 );
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() ) {
while (my $row = $sth->fetchrow_hashref() ) {