Bugzilla – Attachment 165812 Details for
Bug 35138
Enable configuration of facets with Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35138: Adjust existing data
Bug-35138-Adjust-existing-data.patch (text/plain), 4.02 KB, created by
Jonathan Druart
on 2024-04-29 21:06:58 UTC
(
hide
)
Description:
Bug 35138: Adjust existing data
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-04-29 21:06:58 UTC
Size:
4.02 KB
patch
obsolete
>From 5102045b98697f971e2e1e25719ef6d959561dfa Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 21 Mar 2024 10:15:23 +0100 >Subject: [PATCH] Bug 35138: Adjust existing data > >We want the label from the DB displayed on the UI so we are adjusting >the yaml and the DB. > >Sponsored-by: The Research University in the Helmholtz Association (KIT) >Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../searchengine/elasticsearch/mappings.yaml | 20 +++++------ > .../data/mysql/atomicupdate/bug_35138.pl | 33 +++++++++++++++++++ > 2 files changed, 43 insertions(+), 10 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_35138.pl > >diff --git a/admin/searchengine/elasticsearch/mappings.yaml b/admin/searchengine/elasticsearch/mappings.yaml >index 6011923d736..16aaabfdbb9 100644 >--- a/admin/searchengine/elasticsearch/mappings.yaml >+++ b/admin/searchengine/elasticsearch/mappings.yaml >@@ -986,7 +986,7 @@ biblios: > type: '' > author: > facet_order: 1 >- label: author >+ label: Authors > mandatory: ~ > mappings: > - facet: 1 >@@ -1281,7 +1281,7 @@ biblios: > type: '' > ccode: > facet_order: 7 >- label: collection-code >+ label: Collections > mandatory: ~ > mappings: > - facet: 1 >@@ -1875,7 +1875,7 @@ biblios: > type: geo_point > holdingbranch: > facet_order: 8 >- label: holdinglibrary >+ label: Holding libraries > mandatory: ~ > mappings: > - facet: 1 >@@ -1893,7 +1893,7 @@ biblios: > type: string > homebranch: > facet_order: 9 >- label: homelibrary >+ label: Home libraries > mandatory: ~ > mappings: > - facet: 1 >@@ -2151,7 +2151,7 @@ biblios: > type: '' > itype: > facet_order: 2 >- label: itype >+ label: Item types > mandatory: ~ > mappings: > - facet: 1 >@@ -2503,7 +2503,7 @@ biblios: > type: '' > ln: > facet_order: 10 >- label: ln >+ label: Languages > mandatory: ~ > mappings: > - facet: 1 >@@ -2584,7 +2584,7 @@ biblios: > type: number > location: > facet_order: 3 >- label: location >+ label: Location > mandatory: ~ > mappings: > - facet: 1 >@@ -3380,7 +3380,7 @@ biblios: > type: '' > su-geo: > facet_order: 4 >- label: su-geo >+ label: Places > mandatory: ~ > mappings: > - facet: 1 >@@ -3398,7 +3398,7 @@ biblios: > type: string > subject: > facet_order: 6 >- label: subject >+ label: Topics > mandatory: ~ > mappings: > - facet: 1 >@@ -4160,7 +4160,7 @@ biblios: > type: '' > title-series: > facet_order: 5 >- label: title-series >+ label: Series > mandatory: ~ > mappings: > - facet: 1 >diff --git a/installer/data/mysql/atomicupdate/bug_35138.pl b/installer/data/mysql/atomicupdate/bug_35138.pl >new file mode 100755 >index 00000000000..14b48246faa >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_35138.pl >@@ -0,0 +1,33 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "35138", >+ description => "Make the elastic facets editable", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ my $facets = { >+ author => 'Authors', >+ itype => 'Item types', >+ location => 'Location', >+ 'su-geo' => 'Places', >+ 'title-series' => 'Series', >+ subject => 'Topics', >+ ln => 'Languages', >+ }; >+ # Do not update the label if different from the original one >+ my $sth = $dbh->prepare(q{ >+ UPDATE search_field >+ SET label = ? >+ WHERE name = ? AND label = ? >+ }); >+ while ( my ( $name, $label ) = each %$facets ) { >+ $sth->execute( $label, $name, $name ); >+ } >+ >+ $sth->execute( 'Collections', 'ccode', 'collection-code'); >+ $sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary'); >+ $sth->execute( 'Home libraries', 'homebranch', 'homelibrary'); >+ }, >+}; >-- >2.34.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 35138
:
163133
|
163680
|
163681
|
163682
|
163683
|
163684
|
163896
|
163897
|
163898
|
163899
|
163900
|
164811
|
164812
|
164813
|
164814
|
164815
|
164816
|
165811
| 165812 |
165813
|
165814
|
165815
|
165816
|
165817
|
165818
|
166402