Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

* 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.

lotus3fbfd5a78b66
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
"<a href=\"yacysearch.html?display=" + display +
diff --git a/source/de/anomic/index/indexRAMRI.java b/source/de/anomic/index/indexRAMRI.java
index c109ae40b..e8a014523 100644
--- a/source/de/anomic/index/indexRAMRI.java
+++ b/source/de/anomic/index/indexRAMRI.java
@@ -75,11 +75,11 @@ public final class indexRAMRI implements indexRI, indexRIReader {
}
} catch (final IOException e){
log.logSevere("unable to restore cache dump: " + e.getMessage(), e);
- indexHeapFile.delete();
+ // get empty dump
heap.initWriteMode();
} catch (final NegativeArraySizeException e){
log.logSevere("unable to restore cache dump: " + e.getMessage(), e);
- indexHeapFile.delete();
+ // get empty dump
heap.initWriteMode();
}
} else {
diff --git a/source/de/anomic/server/serverObjects.java b/source/de/anomic/server/serverObjects.java
index 0e7b3f262..7c1e1160c 100644
--- a/source/de/anomic/server/serverObjects.java
+++ b/source/de/anomic/server/serverObjects.java
@@ -264,6 +264,13 @@ public class serverObjects extends HashMap<String, String> 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) {