From 89ae6101b9bb0c2a56c7f14b4de4d1edf1cce0a0 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 29 Dec 2010 14:51:07 +0000 Subject: [PATCH] fix for NPE and added comment in search result git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7412 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/js/yacyinteractive.js | 2 +- source/de/anomic/search/RankingProcess.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htroot/js/yacyinteractive.js b/htroot/js/yacyinteractive.js index 755df524b..14bed7f87 100644 --- a/htroot/js/yacyinteractive.js +++ b/htroot/js/yacyinteractive.js @@ -85,7 +85,7 @@ function hideDownloadScript() { function resultNavigation() { var html = ""; if (totalResults > 0) { - html += "
" + searchresult.length + " results from a total of " + totalResults + " docs in index; search time: " + ((new Date()).getTime() - start.getTime()) + " milliseconds. "; + html += "
" + searchresult.length + " results from a total of " + totalResults + " docs in index (not showing offline resources); search time: " + ((new Date()).getTime() - start.getTime()) + " milliseconds. "; html += "
"; } else { if (query == "") { diff --git a/source/de/anomic/search/RankingProcess.java b/source/de/anomic/search/RankingProcess.java index 97212bfad..bb1064d78 100644 --- a/source/de/anomic/search/RankingProcess.java +++ b/source/de/anomic/search/RankingProcess.java @@ -563,8 +563,9 @@ public final class RankingProcess extends Thread { final Iterator domhashs = this.hostNavigator.keys(false); URIMetadataRow row; String domhash, urlhash, hostname; - while (domhashs.hasNext() && result.size() < 30) { + if (this.hostResolver != null) while (domhashs.hasNext() && result.size() < 30) { domhash = domhashs.next(); + if (domhash == null) continue; urlhash = this.hostResolver.get(domhash); row = urlhash == null ? null : this.query.getSegment().urlMetadata().load(urlhash.getBytes(), null, 0); hostname = row == null ? null : row.metadata().url().getHost();