Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fix for search result page navigation
orbitera1e9e6e2e655
diff --git a/htroot/yacysearch.html b/htroot/yacysearch.htmlindex 7b6ab5fa9..cef486e14 100644--- a/htroot/yacysearch.html+++ b/htroot/yacysearch.html@@ -31,7 +31,6 @@<input type="hidden" name="count" value="#[count]#" /><input type="hidden" name="offset" value="#[offset]#" /><input type="hidden" name="resource" value="#[resource]#" />- <input type="hidden" name="time" value="#[time]#" /><input type="hidden" name="urlmaskfilter" value="#[urlmaskfilter]#" /><input type="hidden" name="prefermaskfilter" value="#[prefermaskfilter]#" /><input type="hidden" name="depth" value="#[depth]#" />diff --git a/htroot/yacysearch.java b/htroot/yacysearch.javaindex 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("<strong><</strong></a> ");}- 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("<strong>");diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.javaindex c384859f9..22cd997eb 100644--- a/htroot/yacysearchitem.java+++ b/htroot/yacysearchitem.java@@ -85,7 +85,8 @@ public class yacysearchitem {// dynamically update count valuesif (!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.javaindex 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<indexContainer> 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.javaindex 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<byte[]> implementbyte[] 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.javaindex 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.javaindex 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.javaindex 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;