From 97f1ca52bdbdaba9006878d51b2089d67a42771c Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 3 Oct 2007 15:45:12 +0000 Subject: [PATCH] fox for http://forum.yacy-websuche.de/viewtopic.php?f=6&t=390 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4136 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaSearchEvent.java | 2 +- source/de/anomic/yacy/yacyClient.java | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/plasma/plasmaSearchEvent.java b/source/de/anomic/plasma/plasmaSearchEvent.java index cf6039592..6436d68d2 100644 --- a/source/de/anomic/plasma/plasmaSearchEvent.java +++ b/source/de/anomic/plasma/plasmaSearchEvent.java @@ -389,7 +389,7 @@ public final class plasmaSearchEvent { startTime = System.currentTimeMillis(); plasmaSnippetCache.TextSnippet snippet = plasmaSnippetCache.retrieveTextSnippet(comp.url(), snippetFetchWordHashes, fetchSnippetOnline, query.constraint.get(plasmaCondenser.flag_cat_indexof), 180, 3000, (fetchSnippetOnline) ? Integer.MAX_VALUE : 100000); long snippetComputationTime = System.currentTimeMillis() - startTime; - serverLog.logInfo("SEARCH_EVENT", "text snippet load time for " + comp.url() + ": " + snippetComputationTime); + serverLog.logInfo("SEARCH_EVENT", "text snippet load time for " + comp.url() + ": " + snippetComputationTime + ", " + ((snippet.getErrorCode() < 11) ? "snippet found" : ("no snippet found (" + snippet.getError() + ")"))); if (snippet.getErrorCode() < 11) { // we loaded the file and found the snippet diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.java index 48df9f287..95c0ec34b 100644 --- a/source/de/anomic/yacy/yacyClient.java +++ b/source/de/anomic/yacy/yacyClient.java @@ -436,7 +436,14 @@ public final class yacyClient { // now create a plasmaIndex out of this result // System.out.println("yacyClient: " + ((urlhashes.length() == 0) ? "primary" : "secondary")+ " search result = " + result.toString()); // debug - final int results = Integer.parseInt((String) result.get("count")); + int results = 0; + try { + results = Integer.parseInt((String) result.get("count")); + } catch (NumberFormatException e) { + yacyCore.log.logFine("SEARCH failed FROM " + target.hash + ":" + target.getName() + ", wrong output format"); + yacyCore.peerActions.peerDeparture(target, "search request to peer created number format exception"); + return null; + } // System.out.println("***result count " + results); // create containers