File tree Expand file tree Collapse file tree 5 files changed +32
-2
lines changed
main/java/de/ids_mannheim/korap
java/de/ids_mannheim/korap/search Expand file tree Collapse file tree 5 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1+ 0.64.2 2025-06-18
2+ - [bugfix] Restore rewrites in Meta. (diewald)
3+
140.64.1 2025-05-26
25 - [bugfix] Ignore line endings in indexer tests. (diewald)
36 - [bugfix] Correctly cleanup test directories. (diewald)
Original file line number Diff line number Diff line change 3535
3636 <groupId >de.ids-mannheim.korap.krill</groupId >
3737 <artifactId >Krill</artifactId >
38- <version >0.64.1 </version >
38+ <version >0.64.2 </version >
3939 <packaging >jar</packaging >
4040
4141 <name >Krill</name >
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ public final class KrillMeta extends Notifications {
3434 private ArrayList <String > fields ;
3535 HashSet <Integer > highlights ;
3636
37+ private JsonNode rewrites ;
38+
3739 // Timeout search after milliseconds
3840 private long timeout = (long ) 120_000 ;
3941 // private long timeoutStart = Long.MIN_VALUE;
@@ -160,6 +162,9 @@ public KrillMeta fromJson (JsonNode json) {
160162 if (json .has ("context" ))
161163 this .context .fromJson (json .get ("context" ));
162164
165+ if (json .has ("rewrites" ))
166+ this .rewrites = json .get ("rewrites" );
167+
163168 // Defined highlights
164169 if (json .has ("highlight" )) {
165170
@@ -270,6 +275,11 @@ public SearchContext getContext () {
270275 };
271276
272277
278+ public JsonNode getRewrites () {
279+ return this .rewrites ;
280+ };
281+
282+
273283 public KrillMeta setContext (SearchContext context ) {
274284 this .context = context ;
275285 return this ;
@@ -424,6 +434,9 @@ public JsonNode toJsonNode () {
424434 json .set ("highlight" , highlightNode );
425435 };
426436
437+ if (this .getRewrites () != null )
438+ json .set ("rewrites" , this .getRewrites ());
439+
427440 return json ;
428441 };
429442};
Original file line number Diff line number Diff line change @@ -151,6 +151,10 @@ public void searchMetaFieldsNew () throws IOException {
151151 assertEquals ("match-GOE_AGX.00002-p7-8" ,
152152 res .at ("/matches/0/matchID" ).asText ());
153153
154+ assertFalse (res .at ("/meta/rewrites" ).isMissingNode ());
155+ assertEquals ("Kustvakt" , res .at ("/meta/rewrites/0/src" ).asText ());
156+
157+
154158 // All fields
155159 jsonString = getJsonString (getClass ()
156160 .getResource ("/queries/metas/fields_all.jsonld" ).getFile ());
@@ -182,6 +186,7 @@ public void searchMetaFieldsNew () throws IOException {
182186 // assertEquals("372-377", res.at("/matches/0/pages").asText());
183187 assertEquals ("match-GOE_AGX.00002-p7-8" ,
184188 res .at ("/matches/0/matchID" ).asText ());
189+ assertTrue (res .at ("/meta/rewrites" ).isMissingNode ());
185190
186191
187192 // @All fields
Original file line number Diff line number Diff line change 33 "announcements" : [ ] ,
44 "errors" : [ ] ,
55 "meta" : {
6- "count" :9
6+ "count" :9 ,
7+ "rewrites" :[
8+ {
9+ "@type" : "koral:rewrite" ,
10+ "src" : "Kustvakt" ,
11+ "origin" : "Kustvakt" ,
12+ "scope" : "count" ,
13+ "source" : 10
14+ }
15+ ]
716 } ,
817 "query" : {
918 "@type" : "koral:token" ,
You can’t perform that action at this time.
0 commit comments