]> git.koha-community.org Git - koha.git/commit
Bug 30142: Remove spaces from ElasticSearch mapping MARC fields
authorThomas Klausner <domm@plix.at>
Mon, 21 Feb 2022 11:35:15 +0000 (12:35 +0100)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Mon, 25 Apr 2022 20:40:11 +0000 (20:40 +0000)
commit979d284bae9536a018e2b106e1110c4021476490
tree6d8a35e4535a6b82fe0225b2161876321389618c
parentffd170d51f80a218a0769aa7a5138d23bdd2508e
Bug 30142: Remove spaces from ElasticSearch mapping MARC fields

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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0dbb236d891b69f09ab06a62e2679755ea36621c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
admin/searchengine/elasticsearch/mappings.pl