From 8349e6955e306caabdb46a7c2c1ddd11496eadcd Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Fri, 12 Jun 2015 15:19:39 +1200 Subject: [PATCH] Bug 12478: fix issues with the conversion SQL Signed-off-by: Nick Clemens Signed-off-by: Jesse Weaver Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall Signed-off-by: Brendan Gallagher --- Koha/ElasticSearch.pm | 1 - installer/data/mysql/elasticsearch_mapping.sql | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Koha/ElasticSearch.pm b/Koha/ElasticSearch.pm index 0f3443c307..80bd51eb5b 100644 --- a/Koha/ElasticSearch.pm +++ b/Koha/ElasticSearch.pm @@ -247,7 +247,6 @@ sub get_fixer_rules { } } ); -die Dumper(\@rules); return \@rules; } diff --git a/installer/data/mysql/elasticsearch_mapping.sql b/installer/data/mysql/elasticsearch_mapping.sql index a218c8be44..1bb7da68a6 100644 --- a/installer/data/mysql/elasticsearch_mapping.sql +++ b/installer/data/mysql/elasticsearch_mapping.sql @@ -92,7 +92,7 @@ INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `m INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,'string','110a','200g','110a'); INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,'string','111a',NULL,'111a'); INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,'string','700a','700a','700a'); -INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,'string','245c','701','245c'); +INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',FALSE,'string','245c','701','245c'); INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','245a','200a','245a'); INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','246','200c','246'); INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','247','200d','247'); @@ -280,12 +280,12 @@ insert into search_marc_map(index_name, marc_type, marc_field, facet) select dis insert into search_marc_map(index_name, marc_type, marc_field, facet) select distinct indexname, 'normarc', normarc, facet from elasticsearch_mapping where normarc is not null; insert into search_field (name, type) select distinct mapping, type from elasticsearch_mapping; -insert into search_marc_to_field(search_field_id, search_marc_map_id) select search_field.id,search_marc_map.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='marc21' AND index_name='biblios'; -insert into search_marc_to_field(search_field_id, search_marc_map_id) select search_field.id,search_marc_map.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='unimarc' AND index_name='biblios'; -insert into search_marc_to_field(search_field_id, search_marc_map_id) select search_field.id,search_marc_map.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='normarc' AND index_name='biblios'; +insert into search_marc_to_field(search_marc_map_id, search_field_id) select search_marc_map.id,search_field.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='marc21' AND indexname='biblios' AND index_name='biblios'; +insert into search_marc_to_field(search_marc_map_id, search_field_id) select search_marc_map.id,search_field.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='unimarc' AND indexname='biblios' AND index_name='biblios'; +insert into search_marc_to_field(search_marc_map_id, search_field_id) select search_marc_map.id,search_field.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='normarc' AND indexname='biblios' AND index_name='biblios'; -insert into search_marc_to_field(search_field_id, search_marc_map_id) select search_field.id,search_marc_map.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='marc21' AND index_name='authorities'; -insert into search_marc_to_field(search_field_id, search_marc_map_id) select search_field.id,search_marc_map.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='unimarc' AND index_name='authorities'; -insert into search_marc_to_field(search_field_id, search_marc_map_id) select search_field.id,search_marc_map.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='normarc' AND index_name='authorities'; +insert into search_marc_to_field(search_marc_map_id, search_field_id) select search_marc_map.id,search_field.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='marc21' AND indexname='authorities' AND index_name='authorities'; +insert into search_marc_to_field(search_marc_map_id, search_field_id) select search_marc_map.id,search_field.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='unimarc' AND indexname='authorities' AND index_name='authorities'; +insert into search_marc_to_field(search_marc_map_id, search_field_id) select search_marc_map.id,search_field.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='normarc' AND indexname='authorities' AND index_name='authorities'; drop table elasticsearch_mapping; -- 2.39.5