Author: orbiter
Date: 2008-02-03 03:23:04 +0100 (Sun, 03 Feb 2008)
New Revision: 4431

Modified:
   trunk/htroot/yacysearch.html
   trunk/htroot/yacysearch.java
   trunk/htroot/yacysearchitem.java
   trunk/source/de/anomic/index/indexCollectionRI.java
   trunk/source/de/anomic/kelondro/kelondroBase64Order.java
   trunk/source/de/anomic/kelondro/kelondroEcoTable.java
   trunk/source/de/anomic/kelondro/kelondroRowCollection.java
   trunk/source/de/anomic/plasma/plasmaWordIndex.java
Log:
fix for search result page navigation

Modified: trunk/htroot/yacysearch.html
===================================================================
--- trunk/htroot/yacysearch.html        2008-02-02 23:53:39 UTC (rev 4430)
+++ trunk/htroot/yacysearch.html        2008-02-03 02:23:04 UTC (rev 4431)
@@ -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]#" />

Modified: trunk/htroot/yacysearch.java
===================================================================
--- trunk/htroot/yacysearch.java        2008-02-02 23:53:39 UTC (rev 4430)
+++ trunk/htroot/yacysearch.java        2008-02-03 02:23:04 UTC (rev 4431)
@@ -318,10 +318,11 @@
             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 @@
                 resnav.append(navurla(thispage - 1, display, theQuery));
                 resnav.append("<strong>&lt;</strong></a>&nbsp;");
             }
-            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>");

Modified: trunk/htroot/yacysearchitem.java
===================================================================
--- trunk/htroot/yacysearchitem.java    2008-02-02 23:53:39 UTC (rev 4430)
+++ trunk/htroot/yacysearchitem.java    2008-02-03 02:23:04 UTC (rev 4431)
@@ -85,7 +85,8 @@
 
         // 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 @@
         if (p < 0) return s.substring(0, length - 3) + "...";
         return s.substring(0, length - (s.length() - p) - 3) + "..." + 
s.substring(p);
     }
+
 }

Modified: trunk/source/de/anomic/index/indexCollectionRI.java
===================================================================
--- trunk/source/de/anomic/index/indexCollectionRI.java 2008-02-02 23:53:39 UTC 
(rev 4430)
+++ trunk/source/de/anomic/index/indexCollectionRI.java 2008-02-03 02:23:04 UTC 
(rev 4431)
@@ -181,7 +181,7 @@
 
     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();

Modified: trunk/source/de/anomic/kelondro/kelondroBase64Order.java
===================================================================
--- trunk/source/de/anomic/kelondro/kelondroBase64Order.java    2008-02-02 
23:53:39 UTC (rev 4430)
+++ trunk/source/de/anomic/kelondro/kelondroBase64Order.java    2008-02-03 
02:23:04 UTC (rev 4431)
@@ -371,6 +371,7 @@
         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;
     }

Modified: trunk/source/de/anomic/kelondro/kelondroEcoTable.java
===================================================================
--- trunk/source/de/anomic/kelondro/kelondroEcoTable.java       2008-02-02 
23:53:39 UTC (rev 4430)
+++ trunk/source/de/anomic/kelondro/kelondroEcoTable.java       2008-02-03 
02:23:04 UTC (rev 4431)
@@ -440,12 +440,14 @@
             
             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);

Modified: trunk/source/de/anomic/kelondro/kelondroRowCollection.java
===================================================================
--- trunk/source/de/anomic/kelondro/kelondroRowCollection.java  2008-02-02 
23:53:39 UTC (rev 4430)
+++ trunk/source/de/anomic/kelondro/kelondroRowCollection.java  2008-02-03 
02:23:04 UTC (rev 4431)
@@ -496,7 +496,10 @@
             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);
        }

Modified: trunk/source/de/anomic/plasma/plasmaWordIndex.java
===================================================================
--- trunk/source/de/anomic/plasma/plasmaWordIndex.java  2008-02-02 23:53:39 UTC 
(rev 4430)
+++ trunk/source/de/anomic/plasma/plasmaWordIndex.java  2008-02-03 02:23:04 UTC 
(rev 4431)
@@ -248,9 +248,6 @@
             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;

_______________________________________________
YaCy-svn mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/yacy-svn

Antwort per Email an