Browse Source

Bug 23204: Fix ordering of fields in exported file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Nick Clemens 1 year ago
committed by Martin Renvoize
parent
commit
e578d0b36b
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 6
      Koha/SearchEngine/Elasticsearch.pm
  2. 7
      installer/data/mysql/atomicupdate/Bug_23204_change_search_marc_map_enum_order.perl

6
Koha/SearchEngine/Elasticsearch.pm

@ -267,7 +267,7 @@ sub raw_elasticsearch_mappings {
{ search_field_id => $search_field->id },
{
join => 'search_marc_map',
order_by => { -asc => 'search_marc_map.marc_field' }
order_by => { -asc => ['search_marc_map.marc_type','search_marc_map.marc_field'] }
}
);
@ -279,8 +279,8 @@ sub raw_elasticsearch_mappings {
$mappings->{ $marc_map->index_name }{ $search_field->name }{label} = $search_field->label;
$mappings->{ $marc_map->index_name }{ $search_field->name }{type} = $search_field->type;
$mappings->{ $marc_map->index_name }{ $search_field->name }{facet_order} = $search_field->facet_order;
$mappings->{ $marc_map->index_name }{ $search_field->name }{weight} = $search_field->weight || undef;
$mappings->{ $marc_map->index_name }{ $search_field->name }{facet_order} = $search_field->facet_order if defined $search_field->facet_order;
$mappings->{ $marc_map->index_name }{ $search_field->name }{weight} = $search_field->weight if defined $search_field->weight;
push (@{ $mappings->{ $marc_map->index_name }{ $search_field->name }{mappings} },
{

7
installer/data/mysql/atomicupdate/Bug_23204_change_search_marc_map_enum_order.perl

@ -0,0 +1,7 @@
$DBversion = 'XXX';
if( CheckVersion( $DBversion ) ) {
$dbh->do(q{
ALTER TABLE search_marc_map CHANGE marc_type `marc_type` enum('marc21','normarc','unimarc') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'what MARC type this map is for';
});
NewVersion( $DBversion, 23204, "Change enum order for marc_type in search_marc_map to fix sorting");
}
Loading…
Cancel
Save