result = new ArrayList<>();
addMatches(json, Property.NARROW_MATCH, result);
diff --git a/app/views/tags/browse_list.scala.html b/app/views/tags/browse_list.scala.html
index 1cde8c0..8bf5d99 100644
--- a/app/views/tags/browse_list.scala.html
+++ b/app/views/tags/browse_list.scala.html
@@ -67,6 +67,8 @@
@for(json <- classes.getOrElse(Seq());
entryLabel = label(json);
+ altLabel = (json\"altLabel").asOpt[Seq[String]].getOrElse(Seq()).mkString("; ");
+ example = (json\"example").asOpt[Seq[String]].getOrElse(Seq()).mkString("; ");
normalized = entryLabel.replaceAll("ß", "ss") + entryLabel.replaceAll("ss", "ß");
value = (json\"value").as[String];
hits = (json\"hits").asOpt[scala.Long].getOrElse(0L);
@@ -107,7 +109,7 @@ Links für @Html(entryLabel
}
@if(t!="Zeitschriften"){}
-
@normalized
+ @normalized @altLabel @example
}
@if(t=="Wikidata"){
@if(anchor.startsWith("Q")) {
diff --git a/test/tests/InternalIntegrationTest.java b/test/tests/InternalIntegrationTest.java
index 93c756d..0276d61 100644
--- a/test/tests/InternalIntegrationTest.java
+++ b/test/tests/InternalIntegrationTest.java
@@ -101,6 +101,26 @@ public void testLeadingBlanksInSearchWord() {
searchLeadingBlankWith("word=");
}
+ @Test // See https://github.com/hbz/nwbib/issues/657
+ public void testSearchInAltLabel() {
+ running(testServer(3333), () -> {
+ assertIndexDataForIdContains("N566042", "Ortsteil"); // from altLabel
+ });
+ }
+
+ @Test // See https://github.com/hbz/nwbib/issues/657
+ public void testSearchInExample() {
+ running(testServer(3333), () -> {
+ assertIndexDataForIdContains("N543620", "Betriebsrat"); // from example
+ });
+ }
+
+ private static void assertIndexDataForIdContains(String id, String string) {
+ assertThat(
+ Classification.ids("https://nwbib.de/subjects#" + id, "").toString())
+ .as("index data for " + id).contains(string);
+ }
+
private static void searchLeadingBlankWith(String param) {
running(testServer(3333), () -> {
try {