diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html index 7b6ab5fa9..cef486e14 100644 --- a/htroot/yacysearch.html +++ b/htroot/yacysearch.html @@ -31,7 +31,6 @@ - diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index c3192ceeb..b774f4daf 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -318,10 +318,11 @@ public class yacysearch { sb.localSearchTracker.put(client, handles); prop = new serverObjects(); + int totalcount = theSearch.getRankingResult().getLocalResourceSize() + theSearch.getRankingResult().getRemoteResourceSize(); prop.put("num-results_offset", offset); prop.put("num-results_itemscount", "0"); prop.put("num-results_itemsPerPage", itemsPerPage); - prop.put("num-results_totalcount", yFormatter.number(theSearch.getRankingResult().getLocalResourceSize() + theSearch.getRankingResult().getRemoteResourceSize(), !rss)); + prop.put("num-results_totalcount", yFormatter.number(totalcount, !rss)); prop.put("num-results_globalresults", (globalsearch) ? "1" : "0"); prop.put("num-results_globalresults_localResourceSize", yFormatter.number(theSearch.getRankingResult().getLocalResourceSize(), !rss)); prop.put("num-results_globalresults_remoteResourceSize", yFormatter.number(theSearch.getRankingResult().getRemoteResourceSize(), !rss)); @@ -335,7 +336,7 @@ public class yacysearch { resnav.append(navurla(thispage - 1, display, theQuery)); resnav.append("< "); } - int numberofpages = Math.min(10, Math.min(thispage + 2, (theSearch.getRankingResult().getRemoteResourceSize() + theSearch.getRankingResult().getLocalResourceSize()) / theQuery.displayResults())); + int numberofpages = Math.min(10, Math.max(thispage + 2, totalcount / theQuery.displayResults())); for (int i = 0; i < numberofpages; i++) { if (i == thispage) { resnav.append(""); diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java index c384859f9..22cd997eb 100644 --- a/htroot/yacysearchitem.java +++ b/htroot/yacysearchitem.java @@ -85,7 +85,8 @@ public class yacysearchitem { // dynamically update count values if (!rss) { - prop.put("dynamic_offset", theQuery.neededResults() - theQuery.displayResults() + 1); + int offset = theQuery.neededResults() - theQuery.displayResults() + 1; + prop.put("dynamic_offset", offset); prop.put("dynamic_itemscount", (item < 0) ? theQuery.neededResults() : item + 1); prop.put("dynamic_totalcount", yFormatter.number(theSearch.getRankingResult().getLocalResourceSize() + theSearch.getRankingResult().getRemoteResourceSize(), !rss)); prop.put("dynamic_localResourceSize", yFormatter.number(theSearch.getRankingResult().getLocalResourceSize(), !rss)); @@ -284,4 +285,5 @@ public class yacysearchitem { if (p < 0) return s.substring(0, length - 3) + "..."; return s.substring(0, length - (s.length() - p) - 3) + "..." + s.substring(p); } + } diff --git a/source/de/anomic/index/indexCollectionRI.java b/source/de/anomic/index/indexCollectionRI.java index 9c9578f87..87c8d2ab0 100644 --- a/source/de/anomic/index/indexCollectionRI.java +++ b/source/de/anomic/index/indexCollectionRI.java @@ -181,7 +181,7 @@ public class indexCollectionRI implements indexRI { public void addMultipleEntries(List containerList) { try { - for (int i = 0; i < containerList.size(); i++) collectionIndex.merge((indexContainer) containerList.get(i)); + for (int i = 0; i < containerList.size(); i++) collectionIndex.merge(containerList.get(i)); //collectionIndex.mergeMultiple(containerList); } catch (kelondroOutOfLimitsException e) { e.printStackTrace(); diff --git a/source/de/anomic/kelondro/kelondroBase64Order.java b/source/de/anomic/kelondro/kelondroBase64Order.java index c3fd0bb83..69a27069b 100644 --- a/source/de/anomic/kelondro/kelondroBase64Order.java +++ b/source/de/anomic/kelondro/kelondroBase64Order.java @@ -371,6 +371,7 @@ public class kelondroBase64Order extends kelondroAbstractOrder implement byte[] cp = new byte[Math.min(alength, a.length - aoffset)]; for (int i = cp.length - 1; i >= 0; i--) { cp[i] = ahpla[a[aoffset + i]]; + assert cp[i] != -1; } return cp; } diff --git a/source/de/anomic/kelondro/kelondroEcoTable.java b/source/de/anomic/kelondro/kelondroEcoTable.java index b1b4f21cd..1bd8695f8 100644 --- a/source/de/anomic/kelondro/kelondroEcoTable.java +++ b/source/de/anomic/kelondro/kelondroEcoTable.java @@ -440,12 +440,14 @@ public class kelondroEcoTable implements kelondroIndex { if (i == index.size() - 1) { // special handling if the entry is the last entry in the file - index.removei(key); + ix = index.removei(key); + assert ix == i; table.removeRow(i, false); file.cleanLast(); } else { // switch values - index.removei(key); + ix = index.removei(key); + assert ix == i; kelondroRow.Entry te = table.removeOne(); table.set(i, te); diff --git a/source/de/anomic/kelondro/kelondroRowCollection.java b/source/de/anomic/kelondro/kelondroRowCollection.java index 0f450ebfe..41bb5b936 100644 --- a/source/de/anomic/kelondro/kelondroRowCollection.java +++ b/source/de/anomic/kelondro/kelondroRowCollection.java @@ -496,7 +496,10 @@ public class kelondroRowCollection { isort(L, R, swapspace); return; } + assert R > L; int p = partition(L, R, S, swapspace); + assert p > L; + assert p < R; qsort(L, p, 0, swapspace); qsort(p, R, 0, swapspace); } diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java index 7f8cdc68b..1904e93e1 100644 --- a/source/de/anomic/plasma/plasmaWordIndex.java +++ b/source/de/anomic/plasma/plasmaWordIndex.java @@ -248,9 +248,6 @@ public final class plasmaWordIndex implements indexRI { if (c != null) containerList.add(c); } // flush the containers - for (int i = 0; i < containerList.size(); i++) { - collections.addEntries((indexContainer) containerList.get(i)); - } collections.addMultipleEntries(containerList); //System.out.println("DEBUG-Finished flush of " + count + " entries from RAM to DB in " + (System.currentTimeMillis() - start) + " milliseconds"); busyCacheFlush = false;