Bug 21908

Summary: biblio_metadata is missing from the rebuild_zebra.pl tables list
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: Command-line UtilitiesAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: josef.moravec, julian.maurice, lucas, martin.renvoize, nick, pierre-marc.thibault, robin
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17196    
Bug Blocks:    
Attachments: Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables
Bug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl
Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables
Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables
Bug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl
Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables
Bug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl
Bug 21908: (QA follow-up) Remove useless parentheses in query

Description Fridolin Somers 2018-11-29 09:13:47 UTC
Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
It is missing biblio_metadata to allow filtering on MARCXML with ExtractValue.

Also when using table=items we should use DISTINCT(biblionumber) to avoid indexing several times the same biblio record when it has several items.
Comment 1 Fridolin Somers 2018-11-29 09:57:08 UTC
Created attachment 82723 [details] [review]
Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables

Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
It is missing biblio_metadata to allow filtering on MARCXML with ExtractValue.

Test plan :
1) Be sur you have a biblio record with biblionumber 1
2) Run misc/migration_tools/rebuild_zebra.pl -h
3) You see : --table specify a table (can be items, biblioitems, biblio, biblio_metadata) to retrieve biblionumber to index.
4) Run misc/migration_tools/rebuild_zebra.pl -v -b --table biblio_metadata --where="biblio_metadata.biblionumber=1"
5) Check you dont have SQL errors
Comment 2 Fridolin Somers 2018-11-29 09:57:28 UTC
Created attachment 82724 [details] [review]
Bug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl

Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
When using table=items we should use DISTINCT(biblionumber) to avoid indexing several times the same biblio record when it has several items.
This patch adds DISTINCT(biblionumber) in all cases it does not harm if its already unique.

Test plan :
1) Be sur you have a biblio record with biblionumber 1 with 3 items
2) Run misc/migration_tools/rebuild_zebra.pl -v -b --table items --where="biblionumber=1"
3) Without patch you see "Records exported: 3", with patch only one
4) Check indexing works well
Comment 3 Pierre-Marc Thibault 2018-11-30 20:31:07 UTC Comment hidden (obsolete)
Comment 4 Pierre-Marc Thibault 2018-11-30 20:45:14 UTC
Created attachment 82818 [details] [review]
Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables

Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
It is missing biblio_metadata to allow filtering on MARCXML with ExtractValue.

Test plan :
1) Be sur you have a biblio record with biblionumber 1
2) Run misc/migration_tools/rebuild_zebra.pl -h
3) You see : --table specify a table (can be items, biblioitems, biblio, biblio_metadata) to retrieve biblionumber to index.
4) Run misc/migration_tools/rebuild_zebra.pl -v -b --table biblio_metadata --where="biblio_metadata.biblionumber=1"
5) Check you dont have SQL errors

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Comment 5 Pierre-Marc Thibault 2018-11-30 20:45:27 UTC
Created attachment 82819 [details] [review]
Bug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl

Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
When using table=items we should use DISTINCT(biblionumber) to avoid indexing several times the same biblio record when it has several items.
This patch adds DISTINCT(biblionumber) in all cases it does not harm if its already unique.

Test plan :
1) Be sur you have a biblio record with biblionumber 1 with 3 items
2) Run misc/migration_tools/rebuild_zebra.pl -v -b --table items --where="biblionumber=1"
3) Without patch you see "Records exported: 3", with patch only one
4) Check indexing works well

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Comment 6 Julian Maurice 2018-12-07 09:38:12 UTC
Created attachment 82952 [details] [review]
Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables

Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
It is missing biblio_metadata to allow filtering on MARCXML with ExtractValue.

Test plan :
1) Be sur you have a biblio record with biblionumber 1
2) Run misc/migration_tools/rebuild_zebra.pl -h
3) You see : --table specify a table (can be items, biblioitems, biblio, biblio_metadata) to retrieve biblionumber to index.
4) Run misc/migration_tools/rebuild_zebra.pl -v -b --table biblio_metadata --where="biblio_metadata.biblionumber=1"
5) Check you dont have SQL errors

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 7 Julian Maurice 2018-12-07 09:38:16 UTC
Created attachment 82953 [details] [review]
Bug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl

Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
When using table=items we should use DISTINCT(biblionumber) to avoid indexing several times the same biblio record when it has several items.
This patch adds DISTINCT(biblionumber) in all cases it does not harm if its already unique.

Test plan :
1) Be sur you have a biblio record with biblionumber 1 with 3 items
2) Run misc/migration_tools/rebuild_zebra.pl -v -b --table items --where="biblionumber=1"
3) Without patch you see "Records exported: 3", with patch only one
4) Check indexing works well

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 8 Julian Maurice 2018-12-07 09:38:20 UTC
Created attachment 82954 [details] [review]
Bug 21908: (QA follow-up) Remove useless parentheses in query

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 9 Nick Clemens 2018-12-11 20:58:30 UTC
Awesome work all!

Pushed to master for 19.05
Comment 10 Martin Renvoize 2018-12-12 10:56:39 UTC
Pushed to 18.11.x for 18.11.01
Comment 11 Lucas Gass 2018-12-21 21:05:46 UTC
backported to 18.05 for 18.05.08
Comment 12 Fridolin Somers 2019-01-02 09:25:29 UTC
Pushed to 17.11.x for 17.11.14