From 3b710e2b2212bedea139d83da4655033c67fea08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Fri, 29 Sep 2023 10:11:03 +0200 Subject: [PATCH 1/6] Change related.issn to array and delete - #1828 --- src/main/resources/alma/fix/relatedRessourcesAndLinks.fix | 4 +++- src/test/resources/alma-fix/990108873860206441.json | 2 +- src/test/resources/alma-fix/991005935279706485.json | 2 +- src/test/resources/alma-fix/99370678063606441.json | 2 +- src/test/resources/alma-fix/99370690532406441.json | 2 +- src/test/resources/alma-fix/99370699582506441.json | 2 +- src/test/resources/alma-fix/99371107766906441.json | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix b/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix index c4cc0559e..9b2cb94b8 100644 --- a/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix +++ b/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix @@ -351,7 +351,8 @@ do list(path:"775??|776??", "var":"$i") paste("related[].$last.note[].$append","$i.i", "$i.n") replace_all("related[].$last.note[].$last", "Erscheint auch als ","") copy_field("$i.t", "related[].$last.label") - copy_field("$i.x", "related[].$last.issn") + set_array("related[].$last.issn[]") + copy_field("$i.x", "related[].$last.issn[].$append") set_array("$i.isbn13") set_array("$i.isbn10") do list(path: "$i.z", "var":"$j") @@ -369,6 +370,7 @@ end do list(path:"related[]", "var":"$i") uniq("$i.isbn[]") + replace_all("$i.issn[].*","-","") end replace_all("related[].*.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!") diff --git a/src/test/resources/alma-fix/990108873860206441.json b/src/test/resources/alma-fix/990108873860206441.json index 7854371ba..a4334f009 100644 --- a/src/test/resources/alma-fix/990108873860206441.json +++ b/src/test/resources/alma-fix/990108873860206441.json @@ -79,7 +79,7 @@ "id" : "http://lobid.org/resources/ZDB-1027374-8#!", "note" : [ "Druckausg." ], "label" : "Behavioural pharmacology", - "issn" : "0955-8810" + "issn" : [ "09558810" ] } ], "inCollection" : [ { "id" : "http://lobid.org/organisations/DE-655#!", diff --git a/src/test/resources/alma-fix/991005935279706485.json b/src/test/resources/alma-fix/991005935279706485.json index 1f53d20e0..2ec8bb403 100644 --- a/src/test/resources/alma-fix/991005935279706485.json +++ b/src/test/resources/alma-fix/991005935279706485.json @@ -103,7 +103,7 @@ "related" : [ { "note" : [ "Online-Ausg." ], "label" : "Wirtschaft und Erziehung.", - "issn" : "0174-6170" + "issn" : [ "01746170" ] } ], "inCollection" : [ { "id" : "http://lobid.org/resources/HT014846970#!", diff --git a/src/test/resources/alma-fix/99370678063606441.json b/src/test/resources/alma-fix/99370678063606441.json index 2fd45240c..4403c6cc0 100644 --- a/src/test/resources/alma-fix/99370678063606441.json +++ b/src/test/resources/alma-fix/99370678063606441.json @@ -60,7 +60,7 @@ "label" : "ZDB-Ressource" } ], "related" : [ { - "issn" : "0720-6763" + "issn" : [ "07206763" ] } ], "inCollection" : [ { "id" : "http://lobid.org/resources/HT014846970#!", diff --git a/src/test/resources/alma-fix/99370690532406441.json b/src/test/resources/alma-fix/99370690532406441.json index d1733ddc4..e6c33cdd8 100644 --- a/src/test/resources/alma-fix/99370690532406441.json +++ b/src/test/resources/alma-fix/99370690532406441.json @@ -55,7 +55,7 @@ } ] }, "related" : [ { - "issn" : "1610-5982" + "issn" : [ "16105982" ] } ], "language" : [ { "id" : "http://id.loc.gov/vocabulary/iso639-2/ger", diff --git a/src/test/resources/alma-fix/99370699582506441.json b/src/test/resources/alma-fix/99370699582506441.json index e997763a2..a625a0a98 100644 --- a/src/test/resources/alma-fix/99370699582506441.json +++ b/src/test/resources/alma-fix/99370699582506441.json @@ -75,7 +75,7 @@ "label" : "DNB-Ressource" } ], "related" : [ { - "issn" : "2190-0574" + "issn" : [ "21900574" ] } ], "inCollection" : [ { "id" : "http://lobid.org/resources/HT014846970#!", diff --git a/src/test/resources/alma-fix/99371107766906441.json b/src/test/resources/alma-fix/99371107766906441.json index dcb90ee84..f050008e2 100644 --- a/src/test/resources/alma-fix/99371107766906441.json +++ b/src/test/resources/alma-fix/99371107766906441.json @@ -55,7 +55,7 @@ "label" : "OCLC Ressource" } ], "related" : [ { - "issn" : "2471-5506" + "issn" : [ "24715506" ] } ], "language" : [ { "id" : "http://id.loc.gov/vocabulary/iso639-2/eng", From d391be82cf4f08cdc80381c4b727039fafe4f66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Fri, 29 Sep 2023 11:06:30 +0200 Subject: [PATCH 2/6] Update test #1828 --- web/test/tests/IndexIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/test/tests/IndexIntegrationTest.java b/web/test/tests/IndexIntegrationTest.java index f3f6ca26a..56e1f7c1e 100644 --- a/web/test/tests/IndexIntegrationTest.java +++ b/web/test/tests/IndexIntegrationTest.java @@ -116,7 +116,7 @@ public static Collection data() { { "q.all:(Courtillon cinéma)", /*->*/ 1 }, { "q.all:0702075558", /*->*/ 1 }, { "q.all:07\\-0207\\-555\\-8", /*->*/ 1 }, - { "q.all:07206763", /*->*/ 0 }, + { "q.all:07206763", /*->*/ 1 }, { "q.all:0720\\-6763", /*->*/ 1 }, { "q.all:HT072067630", /*->*/ 0 }, { "q.all:(Erleben \\- Verstehen & Lernen)", /*->*/ 3 }, From 18b55a70fa1db7231b77d8b23856b541863d1d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Mon, 2 Oct 2023 09:59:14 +0200 Subject: [PATCH 3/6] Adjust index config #1828 --- src/main/resources/alma/index-config.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/resources/alma/index-config.json b/src/main/resources/alma/index-config.json index ae68271a9..9ec7f8fbe 100644 --- a/src/main/resources/alma/index-config.json +++ b/src/main/resources/alma/index-config.json @@ -265,13 +265,15 @@ "type": "text" }, "issn": { - "type": "keyword", + "type": "text", + "analyzer": "hyphen_analyzer", "copy_to": [ "q.all" ] }, "isbn": { - "type": "keyword", + "type": "text", + "analyzer": "hyphen_analyzer", "copy_to": [ "q.all" ] From 0e134f96cfc1a158b5a377f87042a85a016c3403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Tue, 2 Apr 2024 17:29:28 +0200 Subject: [PATCH 4/6] Update and add tests #1828 This also highlights the different behavion from q.all to the general lobid-search. --- web/test/tests/IndexIntegrationTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/test/tests/IndexIntegrationTest.java b/web/test/tests/IndexIntegrationTest.java index a442acb3a..593572a2b 100644 --- a/web/test/tests/IndexIntegrationTest.java +++ b/web/test/tests/IndexIntegrationTest.java @@ -80,6 +80,10 @@ public static Collection data() { { "isbn:9780702075551", /*->*/ 1}, { "isbn:070-2075-558", /*->*/ 1}, { "isbn:0702075558", /*->*/ 1}, + { "related.issn:07206763", /*->*/ 1 }, + { "related.issn:0720\\-6763", /*->*/ 1 }, + { "issn:21914664", /*->*/ 1 }, + { "issn:2191\\-4664", /*->*/ 1 }, { "\"Handbook on policy, process and governing\"", /*->*/ 1}, { "(+Handbook +on +policy +process +and +governing)", /*->*/ 1}, { "\"Mülheim an der Ruhr\"", /*->*/ 1}, @@ -91,6 +95,7 @@ public static Collection data() { { "describedBy.resultOf.object.modifiedBy.id:\"http\\://lobid.org/organisations/DE-6#\\!\"", /*->*/ 15 }, { "\"Reader-friendly\"", /*->*/ 1}, { "\"Reader friendly\"", /*->*/ 1}, + // all q tests are related to DigiBib { "q.date:2000", /*->*/ 3 }, { "q.publisher:Aachen", /*->*/ 2 }, { "q.publisher:Aachen\\-Eilendorf", /*->*/ 1 }, @@ -115,9 +120,11 @@ public static Collection data() { { "q.all:(Courtillon cinema)", /*->*/ 1 }, { "q.all:(Courtillon cinéma)", /*->*/ 1 }, { "q.all:0702075558", /*->*/ 1 }, - { "q.all:07\\-0207\\-555\\-8", /*->*/ 1 }, + { "q.all:07\\-0207\\-555\\-8", /*->*/ 1 }, // search with hyphens possible due to digibib_standardnumber { "q.all:07206763", /*->*/ 1 }, - { "q.all:0720\\-6763", /*->*/ 1 }, + { "q.all:0720\\-6763", /*->*/ 0 }, // search with hyphens not possible, different to lobid general search + { "q.all:21914664", /*->*/ 1 }, + { "q.all:2191\\-4664", /*->*/ 0 }, // search with hyphens not possible, different to lobid general search { "q.all:HT072067630", /*->*/ 0 }, { "q.all:(Erleben \\- Verstehen & Lernen)", /*->*/ 3 }, { "q.all:(Lexicography \\: Selected Papers)", /*->*/ 1 }, From d34f2793029e06d7ca5f9d9855850c4330e2e33b Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 16 Apr 2024 10:44:39 +0200 Subject: [PATCH 5/6] Fix formatting We use tabs. --- web/test/tests/IndexIntegrationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/test/tests/IndexIntegrationTest.java b/web/test/tests/IndexIntegrationTest.java index 593572a2b..f3becab5d 100644 --- a/web/test/tests/IndexIntegrationTest.java +++ b/web/test/tests/IndexIntegrationTest.java @@ -80,7 +80,7 @@ public static Collection data() { { "isbn:9780702075551", /*->*/ 1}, { "isbn:070-2075-558", /*->*/ 1}, { "isbn:0702075558", /*->*/ 1}, - { "related.issn:07206763", /*->*/ 1 }, + { "related.issn:07206763", /*->*/ 1 }, { "related.issn:0720\\-6763", /*->*/ 1 }, { "issn:21914664", /*->*/ 1 }, { "issn:2191\\-4664", /*->*/ 1 }, @@ -95,7 +95,7 @@ public static Collection data() { { "describedBy.resultOf.object.modifiedBy.id:\"http\\://lobid.org/organisations/DE-6#\\!\"", /*->*/ 15 }, { "\"Reader-friendly\"", /*->*/ 1}, { "\"Reader friendly\"", /*->*/ 1}, - // all q tests are related to DigiBib + // all q tests are related to DigiBib { "q.date:2000", /*->*/ 3 }, { "q.publisher:Aachen", /*->*/ 2 }, { "q.publisher:Aachen\\-Eilendorf", /*->*/ 1 }, From 35e4aac9aa6db0073f3723449ac4ab0ad2a25b31 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 16 Apr 2024 10:46:43 +0200 Subject: [PATCH 6/6] Fix text (#1828) The related.issn is now stored without hyphen. --- src/test/resources/alma-fix/990119186660206441.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/resources/alma-fix/990119186660206441.json b/src/test/resources/alma-fix/990119186660206441.json index 26a0bd0e4..699e4ae8e 100644 --- a/src/test/resources/alma-fix/990119186660206441.json +++ b/src/test/resources/alma-fix/990119186660206441.json @@ -74,7 +74,7 @@ "related" : [ { "note" : [ "Druck-Ausgabe" ], "label" : "Know your world extra", - "issn" : "0163-4844" + "issn" : [ "01634844" ] } ], "inCollection" : [ { "id" : "http://lobid.org/organisations/DE-655#!",