HOT PATCH 2: change int to long for checking total results.
Change-Id: Ibb964a149c3ed8c0bc94c166340ba91d0cdd1850
diff --git a/Changes b/Changes
index 9a68158..1b35355 100644
--- a/Changes
+++ b/Changes
@@ -1,10 +1,11 @@
# version 1.0
-HOT PATCH: Reorder tasks for new VC.
+HOT PATCH 1: Reorder tasks for new VC.
New VC should be cached first to avoid calculating leafs to compute statistics
when storing VC in NamedVCLoader. This allows using existing vc-cache
containing new vc.
+HOT PATCH 2: change int to long for checking total results.
# version 0.80.1-SNAPSHOT
diff --git a/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java b/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java
index 4624720..eeffa13 100644
--- a/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java
+++ b/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java
@@ -256,10 +256,10 @@
ObjectNode queryNode = (ObjectNode) JsonUtils.readTree(result);
ObjectNode meta = (ObjectNode) queryNode.at("/meta");
if (meta.isMissingNode()) {
- queryNode.put("totalResults", Integer.valueOf(totalResults));
+ queryNode.put("totalResults", Long.valueOf(totalResults));
}
else {
- meta.put("totalResults", Integer.valueOf(totalResults));
+ meta.put("totalResults", Long.valueOf(totalResults));
}
result = queryNode.toString();
}
@@ -269,7 +269,7 @@
boolean timeExceeded = node.at("/meta/timeExceeded").asBoolean();
if (!timeExceeded && totalResults != null && !totalResults.isEmpty()
- && Integer.parseInt(totalResults) > 0)
+ && Long.parseLong(totalResults) > 0)
totalResultCache.storeInCache(hashedKoralQuery, totalResults);
}
return result;