Skip to content

Commit

Permalink
Issue #12: Handle ES indexes and mappings
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
tomascohen authored and joubu committed Oct 23, 2017
1 parent 53a4795 commit b510809
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions do_all_you_can_do.pl
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@
my $instance;
my $userid;
my $password;
my $koha_dir;
my $elasticsearch;

GetOptions(
'elasticsearch' => \$elasticsearch,
'instance=s' => \$instance,
'userid=s' => \$userid,
'password=s' => \$password
'koha_dir=s' => \$koha_dir,
'password=s' => \$password,
'userid=s' => \$userid
);

my $create_superlibrarian_opts = "";
Expand All @@ -38,6 +42,7 @@

$instance //= 'kohadev';

$koha_dir //= '/home/vagrant/kohaclone';
my $misc_dir = dirname( abs_path( $0 ) );

my ( $cmd, $success, $error_code, $full_buf, $stdout_buf, $stderr_buf );
Expand All @@ -61,6 +66,11 @@
$cmd = "sudo koha-rebuild-zebra -f -v $instance";
( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run( command => $cmd, verbose => 1 );
exit(1) unless $success;
# TODO Add rebuild ES

if ($elasticsearch) {
$cmd = "sudo koha-shell $instance -p -c 'PERL5LIB=$PERL5LIB perl $koha_dir/misc/search_tools/rebuild_elastic_search.pl -v'";
( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run( command => $cmd, verbose => 1 );
exit(1) unless $success;
}

exit(0);
4 changes: 2 additions & 2 deletions populate_db.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use C4::Installer;
use C4::Context;

#use Koha::SearchEngine::Elasticsearch;
use Koha::SearchEngine::Elasticsearch;

=head1 NAME
Expand Down Expand Up @@ -170,7 +170,7 @@ sub initialize_data {
});

# Initialize ES mappings
#Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings;
Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings;
}

sub execute_sqlfile {
Expand Down

0 comments on commit b510809

Please sign in to comment.