From 5866c73a09e731b4f31d425af3201b49db45bc86 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 23 Nov 2011 15:17:46 +0000 Subject: [PATCH] fix for compare search: use scroogle instead of bing and get a default search if configured search engine is not available git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@8074 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- defaults/yacy.init | 2 +- htroot/compare_yacy.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/defaults/yacy.init b/defaults/yacy.init index ffac6aebe..dc8f1fe41 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -955,7 +955,7 @@ routing.deleteOldSeeds.time = 30 # options to remember the default search engines when using the search compare features compare_yacy.left = YaCy -compare_yacy.right = google.com +compare_yacy.right = scroogle.org # minimum free disk space for crawling (MiB) disk.free = 3000 diff --git a/htroot/compare_yacy.java b/htroot/compare_yacy.java index 853b9d8b8..564a0d755 100755 --- a/htroot/compare_yacy.java +++ b/htroot/compare_yacy.java @@ -36,7 +36,7 @@ import de.anomic.server.servletProperties; public class compare_yacy { private static final String defaultsearchL = "YaCy"; - private static final String defaultsearchR = "bing.com"; + private static final String defaultsearchR = "scroogle.org"; private static final String[] order = {defaultsearchL, "YaCy (local)", "bing.com", /*"google.de",*/ defaultsearchR, "scroogle.org", "metager.de", "metager2.de (web)", "metager2.de (international)", @@ -73,7 +73,9 @@ public class compare_yacy { prop.put("display", display); String default_left = sb.getConfig("compare_yacy.left", defaultsearchL); + if (!searchengines.containsKey(default_left)) default_left = defaultsearchL; String default_right = sb.getConfig("compare_yacy.right", defaultsearchR); + if (!searchengines.containsKey(default_right)) default_right = defaultsearchR; if (post != null) { if (searchengines.get(post.get("left", default_left)) != null) {