From 7d863d625444eff40c7187c11afd454c8d52c30b Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 23 Nov 2014 23:12:01 +0100 Subject: [PATCH] fix empty text facet entry (noticed on Author facet) --- source/net/yacy/peers/Protocol.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/net/yacy/peers/Protocol.java b/source/net/yacy/peers/Protocol.java index df1312b55..fce4b2aca 100644 --- a/source/net/yacy/peers/Protocol.java +++ b/source/net/yacy/peers/Protocol.java @@ -502,7 +502,7 @@ public final class Protocol { // duetime : maximum time that a peer should spent to create a result final long timestamp = System.currentTimeMillis(); - event.addExpectedRemoteReferences(count); + event.addExpectedRemoteReferences(count); SearchResult result = null; for (String ip: target.getIPs()) { //if (ip.indexOf(':') >= 0) System.out.println("Search target: IPv6: " + ip); @@ -531,7 +531,7 @@ public final class Protocol { Network.log.info("SEARCH failed, Peer: " + target.hash + ":" + target.getName() + " (" + e.getMessage() + ")"); event.peers.peerActions.interfaceDeparture(target, ip); return -1; - } + } } if (result == null) return -1; @@ -1016,6 +1016,7 @@ public final class Protocol { for (Count ff: values) { int c = (int) ff.getCount(); if (c == 0) continue; + if (ff.getName().length() == 0) continue; // facet entry without text is not useful result.set(ff.getName(), c); } if (result.size() > 0) facets.put(field, result);