Bugzilla – Attachment 101856 Details for
Bug 23204
Add script for exporting Elasticsearch mappings to YAML
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23204: Fix ordering of fields in exported file
Bug-23204-Fix-ordering-of-fields-in-exported-file.patch (text/plain), 2.74 KB, created by
Jonathan Druart
on 2020-03-26 14:16:40 UTC
(
hide
)
Description:
Bug 23204: Fix ordering of fields in exported file
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-26 14:16:40 UTC
Size:
2.74 KB
patch
obsolete
>From cf11b0f00a3e709d0e7d3c2b94e3dfd100ea4eee Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 25 Mar 2020 17:10:40 +0000 >Subject: [PATCH] Bug 23204: Fix ordering of fields in exported file > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/SearchEngine/Elasticsearch.pm | 6 +++--- > .../Bug_23204_change_search_marc_map_enum_order.perl | 7 +++++++ > 2 files changed, 10 insertions(+), 3 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/Bug_23204_change_search_marc_map_enum_order.perl > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index ce762a00ce..8ee939d2be 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/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} }, > { >diff --git a/installer/data/mysql/atomicupdate/Bug_23204_change_search_marc_map_enum_order.perl b/installer/data/mysql/atomicupdate/Bug_23204_change_search_marc_map_enum_order.perl >new file mode 100644 >index 0000000000..c5493b4d77 >--- /dev/null >+++ b/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"); >+} >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23204
:
90999
|
91350
|
92022
|
92023
|
92024
|
92174
|
93524
|
95986
|
100960
|
100961
|
100962
|
100963
|
100964
|
100965
|
101742
|
101850
|
101851
|
101852
|
101853
|
101854
|
101855
| 101856 |
101857
|
101858
|
102010