From 3fbfd5a78b66e7a4cc610c88848ff791dbd8faa6 Mon Sep 17 00:00:00 2001 From: lotus Date: Tue, 2 Sep 2008 15:09:31 +0000 Subject: [PATCH] * fix for non-changing offset on new search term * dht-heap doesn't has to be deleted (5097), we simply write a new one on exit * do not install YaCy in startup because a Windows-shutdown might corrupt something. Installing YaCy as a service would solve this. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5099 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- build.nsi | 2 ++ htroot/yacy/user/ysearch.java | 2 +- htroot/yacysearch.java | 5 ++++- source/de/anomic/index/indexRAMRI.java | 4 ++-- source/de/anomic/server/serverObjects.java | 7 +++++++ 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/build.nsi b/build.nsi index 08b16f1d3..03003dca6 100755 --- a/build.nsi +++ b/build.nsi @@ -72,10 +72,12 @@ Section "YaCy on the Desktop" CreateShortCut "$DESKTOP\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED SectionEnd +/* Section "YaCy in Startup" SetShellVarContext current CreateShortCut "$SMSTARTUP\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED SectionEnd +*/ Section "Uninstall" IfFileExists "$INSTDIR\DATA\yacy.running" 0 +3 diff --git a/htroot/yacy/user/ysearch.java b/htroot/yacy/user/ysearch.java index 7ba6061a2..30bccdf6e 100644 --- a/htroot/yacy/user/ysearch.java +++ b/htroot/yacy/user/ysearch.java @@ -111,7 +111,7 @@ public class ysearch { } int itemsPerPage = Math.min((authenticated) ? 1000 : 10, post.getInt("maximumRecords", post.getInt("count", 10))); // SRU syntax with old property as alternative - int offset = post.getInt("startRecord", post.getInt("offset", 0)); + int offset = (post.hasValue("query") && post.hasValue("former") && !post.get("query","").equalsIgnoreCase(post.get("former",""))) ? 0 : post.getInt("startRecord", post.getInt("offset", 0)); boolean global = (post == null) ? true : post.get("resource", "global").equals("global"); final boolean indexof = (post != null && post.get("indexof","").equals("on")); diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 313efe3c4..8c99a2f68 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -125,7 +125,7 @@ public class yacysearch { } int itemsPerPage = Math.min((authenticated) ? 1000 : 10, post.getInt("maximumRecords", post.getInt("count", 10))); // SRU syntax with old property as alternative - int offset = post.getInt("startRecord", post.getInt("offset", 0)); + int offset = (post.hasValue("query") && post.hasValue("former") && !post.get("query","").equalsIgnoreCase(post.get("former",""))) ? 0 : post.getInt("startRecord", post.getInt("offset", 0)); boolean global = (post == null) ? true : post.get("resource", "global").equals("global"); final boolean indexof = (post != null && post.get("indexof","").equals("on")); @@ -423,6 +423,9 @@ public class yacysearch { return prop; } + /** + * generates the page navigation bar + */ private static String navurla(final int page, final int display, final plasmaSearchQuery theQuery) { return " implements Cloneable return dflt; } } + + public boolean hasValue(final String key) { + final String s = super.get(key); + if (s == null) return false; + if (s == "") return false; + return true; + } // returns a set of all values where their key mappes the keyMapper public String[] getAll(final String keyMapper) {