Bugzilla – Attachment 132411 Details for
Bug 30142
ElasticSearch MARC mappings should not accept whitespaces
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30142: Remove spaces from ElasticSearch mapping MARC fields
Bug-30142-Remove-spaces-from-ElasticSearch-mapping.patch (text/plain), 2.05 KB, created by
Nick Clemens (kidclamp)
on 2022-03-29 13:22:15 UTC
(
hide
)
Description:
Bug 30142: Remove spaces from ElasticSearch mapping MARC fields
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-03-29 13:22:15 UTC
Size:
2.05 KB
patch
obsolete
>From ea48363f8b95baaee032cb938181d342ccc9d575 Mon Sep 17 00:00:00 2001 >From: Thomas Klausner <domm@plix.at> >Date: Mon, 21 Feb 2022 12:35:15 +0100 >Subject: [PATCH] Bug 30142: Remove spaces from ElasticSearch mapping MARC > fields >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >A first step to "validate" the MARC mappings: Remove all whitespace, so >if a user enters "245a " (with a trailing whitespace, which can easily >happen when copy/pasting) we only store "245a" in the DB. This is >neccessary, because the ES indexer will throw an exception in an invalid >MARC mapping. > >Test Plan: >* Go to /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl >* Go to the Bibliographic Records Tab >* Enter "100 a b c " (notice the whitespaces!) in the first "mapping" > field >* Scroll down and save >* Go back to the Bibliographic Records Tab >* The spaces are still there > >Now apply the patch > >* Repeat the above steps >* After saving you should see "100abc" without any spaces in the > "mapping" field > >Sponsored-by: Steiermärkische Landesbibliothek > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > admin/searchengine/elasticsearch/mappings.pl | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/admin/searchengine/elasticsearch/mappings.pl b/admin/searchengine/elasticsearch/mappings.pl >index b3a05aca64..e4d5ab10ea 100755 >--- a/admin/searchengine/elasticsearch/mappings.pl >+++ b/admin/searchengine/elasticsearch/mappings.pl >@@ -157,7 +157,10 @@ if ( $op eq 'edit' ) { > my $search_field = Koha::SearchFields->find({ name => $search_field_name }, { key => 'name' }); > $mandatory_after++ if $search_field->mandatory && !defined $seen_fields{$search_field_name}; > $seen_fields{$search_field_name} = 1; >+ > # TODO Check mapping format >+ $mapping_marc_field =~ s/\s//g; >+ > my $marc_field = Koha::SearchMarcMaps->find_or_create({ > index_name => $index_name, > marc_type => $marc_type, >-- >2.30.2
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 30142
:
130948
|
130997
| 132411