Bug 17567 - populate_db.pl should initialize ES mappings
Summary: populate_db.pl should initialize ES mappings
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 10337
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-07 14:15 UTC by Tomás Cohen Arazi
Modified: 2017-06-14 22:16 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17567: Make populate_db.pl initialize ES mappings (1.12 KB, patch)
2016-11-07 14:28 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17567: Make populate_db.pl initialize ES mappings (1.78 KB, patch)
2016-11-07 14:34 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17567: Make populate_db.pl initialize ES mappings (1.84 KB, patch)
2016-11-11 11:08 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2016-11-07 14:15:58 UTC
This handy script, which is usually ran on kohadevbox, needs to initialize the ES index mappings so it is easier for users to test ES stuff.
Comment 1 Tomás Cohen Arazi 2016-11-07 14:28:34 UTC
Created attachment 57260 [details] [review]
Bug 17567: Make populate_db.pl initialize ES mappings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2016-11-07 14:34:32 UTC
Created attachment 57262 [details] [review]
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>
Comment 3 Jonathan Druart 2016-11-07 14:57:35 UTC
Tomas, I would build it on top of bug 17529, that way we could reindex the ES indexes as well.
Comment 4 Jonathan Druart 2016-11-11 11:08:36 UTC
Created attachment 57454 [details] [review]
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>
Comment 5 Jonathan Druart 2016-11-11 11:08:58 UTC
Skipping QA, we need it ASAP.
Comment 6 Kyle M Hall 2016-11-12 02:39:52 UTC
Pushed to master for 16.11, thanks Tomas!