fix for search result page navigation

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4431 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2008-02-03 02:23:04 +00:00
parent 7404256997
commit a1e9e6e2e6
8 changed files with 15 additions and 10 deletions

View File

@ -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]#" />

View File

@ -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>&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>");

View File

@ -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);
}
}

View File

@ -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();

View File

@ -371,6 +371,7 @@ public class kelondroBase64Order extends kelondroAbstractOrder<byte[]> 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;
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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;