Bug 22474

Summary: Authority and biblio field mapping improperly shared
Product: Koha Reporter: Ere Maijala <ere.maijala>
Component: Searching - ElasticsearchAssignee: Ere Maijala <ere.maijala>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: lucas, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05
Attachments: Bug 22474: Clone field config before adding fields to it
Bug 22474: Clone field config before adding fields to it
Bug 22474: Clone field config before adding fields to it

Description Ere Maijala 2019-03-07 12:37:10 UTC
Reading field mappings uses the general config as the base for both, which makes them accidentally share the field mappings.
Comment 1 Ere Maijala 2019-03-07 14:36:17 UTC
Created attachment 86278 [details] [review]
Bug 22474: Clone field config before adding fields to it

Test plain:

1. Reindex both authorities and biblios with the -d flag to recreate the index, e.g. "perl misc/search_tools/rebuild_elastic_search.pl -v -d"
2. Check that authorities only contains authority-specific fields in Elasticsearch e.g. by fetching  http://localhost:9200/koha_dev_authorities/_mappings
3. Reindex both without the -d flag and verify it works, e.g. "perl misc/search_tools/rebuild_elastic_search.pl -v"
Comment 2 Björn Nylén 2019-03-15 10:39:24 UTC
Created attachment 86664 [details] [review]
Bug 22474: Clone field config before adding fields to it

Test plain:

1. Reindex both authorities and biblios with the -d flag to recreate the index, e.g. "perl misc/search_tools/rebuild_elastic_search.pl -v -d"
2. Check that authorities only contains authority-specific fields in Elasticsearch e.g. by fetching  http://localhost:9200/koha_dev_authorities/_mappings
3. Reindex both without the -d flag and verify it works, e.g. "perl misc/search_tools/rebuild_elastic_search.pl -v"

Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Comment 3 Chris Cormack 2019-04-15 00:23:12 UTC
Created attachment 87972 [details] [review]
Bug 22474: Clone field config before adding fields to it

Test plain:

1. Reindex both authorities and biblios with the -d flag to recreate the index, e.g. "perl misc/search_tools/rebuild_elastic_search.pl -v -d"
2. Check that authorities only contains authority-specific fields in Elasticsearch e.g. by fetching  http://localhost:9200/koha_dev_authorities/_mappings
3. Reindex both without the -d flag and verify it works, e.g. "perl misc/search_tools/rebuild_elastic_search.pl -v"

Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 4 Nick Clemens (kidclamp) 2019-04-16 13:26:31 UTC
Awesome work all!

Pushed to master for 19.05
Comment 5 Martin Renvoize 2019-04-25 14:05:53 UTC
Pushed to 18.11.x for 18.11.05
Comment 6 Lucas Gass 2019-05-10 20:10:03 UTC
not backporting ES bugs to 18.05.x, not backporting