From b0b48866181d1fe91e63ca866584074397ef256e Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 8 Sep 2011 18:47:00 +0000 Subject: [PATCH] try to avoid the unresolved pattern in search result git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7940 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/js/yacysearch.js | 3 ++- htroot/yacysearchlatestinfo.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/htroot/js/yacysearch.js b/htroot/js/yacysearch.js index 982a81d8a..a887bc04d 100644 --- a/htroot/js/yacysearch.js +++ b/htroot/js/yacysearch.js @@ -72,7 +72,8 @@ function addHover() { function statistics(offset, itemscount, itemsperpage, totalcount, localResourceSize, remoteResourceSize, remoteIndexCount, remotePeerCount, navurlbase) { if (offset >= 0) document.getElementById("resultsOffset").firstChild.nodeValue = offset; - if (itemscount >= 0) document.getElementById("itemscount").firstChild.nodeValue = itemscount; + if (itemscount == 0) return; + document.getElementById("itemscount").firstChild.nodeValue = itemscount; document.getElementById("totalcount").firstChild.nodeValue = totalcount; if (document.getElementById("localResourceSize") == null) return; document.getElementById("localResourceSize").firstChild.nodeValue = localResourceSize; diff --git a/htroot/yacysearchlatestinfo.java b/htroot/yacysearchlatestinfo.java index f6524c23c..0fd3b451c 100644 --- a/htroot/yacysearchlatestinfo.java +++ b/htroot/yacysearchlatestinfo.java @@ -17,7 +17,17 @@ public class yacysearchlatestinfo { final String eventID = post.get("eventID", ""); final SearchEvent theSearch = SearchEventCache.getEvent(eventID); if (theSearch == null) { - // the event does not exist, show empty page + // the event does not exist. + // to avoid missing patterns, we return dummy values + prop.put("offset", 0); + prop.put("itemscount", -1); + prop.put("itemsperpage", 10); + prop.put("totalcount", 0); + prop.put("localResourceSize", 0); + prop.put("localMissCount", 0); + prop.put("remoteResourceSize", 0); + prop.put("remoteIndexCount", 0); + prop.put("remotePeerCount", 0); return prop; } final QueryParams theQuery = theSearch.getQuery();