]> git.koha-community.org Git - koha.git/commit
Bug 37430: (Bug 33407 follow-up) ISBD punctuation removal in ES searches
authorJanusz Kaczmarek <januszop@gmail.com>
Mon, 22 Jul 2024 12:01:40 +0000 (12:01 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 2 Oct 2024 09:42:08 +0000 (10:42 +0100)
commitfc59198172012f2638e40961f7666aae1929837f
tree8e68e1a8118411c6d35a60b761d441b4582f9290
parent7d2cebcd1b559ce9b11c319a79af2ce07d03aa7c
Bug 37430: (Bug 33407 follow-up) ISBD punctuation removal in ES searches

Tiny adjustment for very special and malicious cases needed in
Koha::SearchEngine::Elasticsearch::QueryBuilder::clean_search_term.

Extended unit tests added following Nick's suggestions in
Bug 33407 discussion.

Test plan
=========
1. Use ktd with Elasticsearch and ktd's test data.
2. Edit the 4th record (The C programming language) and add a semicolon
   followed by a space before the slash in 245 $a to have:
   The C programming language ; /
3. Make a search for the first ISBD zone taken verbatim from the forth
   record:
   The C programming language ; / Brian W. Kernighan, Dennis M. Ritchie

   There should be no result.
4. Apply the patch, restart plack.
5. Repeat the search. You should get the record.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm