Bug 17567: Make populate_db.pl initialize ES mappings

To test:
- Have a clean install, no DB
- Run populate_db.pl:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ misc/devel/populate_db.pl
- Go to
http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
=> FAIL: No mappings
- Delete the DB and create an empty one:
  $ mysql -uroot
  > DROP DATABASE koha_kohadev; CREATE DATABASE koha_kohadev;
  > GRANT ALL PRIVILEGES ON koha_kohadev.* TO
  'koha_kohadev'@'localhost';
- Run populate_db.pl:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ misc/devel/populate_db.pl
- Go to
  http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
=> SUCCESS: There are mappings!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Tomas Cohen Arazi 2016-11-07 11:19:03 -03:00 committed by Kyle M Hall
parent 62c09397f2
commit f4bd05d00d
1 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,8 @@ use Pod::Usage;
use C4::Installer;
use C4::Context;
use Koha::SearchEngine::Elasticsearch;
=head1 NAME
populate_db.pl - Load included sample data into the DB
@ -160,6 +162,9 @@ sub initialize_data {
INSERT INTO systempreferences(variable, value, options, explanation, type)
VALUES ('Version', '$version', NULL, 'The Koha database version. WARNING: Do not change this value manually, it is maintained by the webinstaller', NULL)
});
# Initialize ES mappings
Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings;
}
sub execute_sqlfile {