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
pull/1/head
orbiter 14 years ago
parent 0769f4caa6
commit 89ae6101b9

@ -85,7 +85,7 @@ function hideDownloadScript() {
function resultNavigation() { function resultNavigation() {
var html = ""; var html = "";
if (totalResults > 0) { if (totalResults > 0) {
html += "<div>" + searchresult.length + " results from a total of " + totalResults + " docs in index; search time: " + ((new Date()).getTime() - start.getTime()) + " milliseconds.&nbsp;"; html += "<div>" + searchresult.length + " results from a total of " + totalResults + " docs in index (not showing offline resources); search time: " + ((new Date()).getTime() - start.getTime()) + " milliseconds.&nbsp;";
html += "<div id=\"downloadbutton\" style=\"inline\"></div></div>"; html += "<div id=\"downloadbutton\" style=\"inline\"></div></div>";
} else { } else {
if (query == "") { if (query == "") {

@ -563,8 +563,9 @@ public final class RankingProcess extends Thread {
final Iterator<String> domhashs = this.hostNavigator.keys(false); final Iterator<String> domhashs = this.hostNavigator.keys(false);
URIMetadataRow row; URIMetadataRow row;
String domhash, urlhash, hostname; String domhash, urlhash, hostname;
while (domhashs.hasNext() && result.size() < 30) { if (this.hostResolver != null) while (domhashs.hasNext() && result.size() < 30) {
domhash = domhashs.next(); domhash = domhashs.next();
if (domhash == null) continue;
urlhash = this.hostResolver.get(domhash); urlhash = this.hostResolver.get(domhash);
row = urlhash == null ? null : this.query.getSegment().urlMetadata().load(urlhash.getBytes(), null, 0); row = urlhash == null ? null : this.query.getSegment().urlMetadata().load(urlhash.getBytes(), null, 0);
hostname = row == null ? null : row.metadata().url().getHost(); hostname = row == null ? null : row.metadata().url().getHost();

Loading…
Cancel
Save