From 2d36a7eaf5b089f40f79eaf219ef94f6f861e024 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Fri, 15 Mar 2013 00:14:28 +0100 Subject: [PATCH] - do not create a new query for all remote peers - no document search this time - adjusted banner and network to not show 'WORDS' but DHT Chunks. This is to avoid confusion for robinson peers which do not create Word Entries --- defaults/yacy.init | 4 ++-- htroot/Network.html | 8 +++---- source/net/yacy/peers/Protocol.java | 2 +- source/net/yacy/peers/RemoteSearch.java | 7 +++++- source/net/yacy/peers/graphics/Banner.java | 24 +++++++++---------- source/net/yacy/search/query/SearchEvent.java | 6 ++--- 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/defaults/yacy.init b/defaults/yacy.init index 6c4032a01..b97f077e0 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -742,8 +742,8 @@ search.options = true # search domains. If set to false then that search is not available search.text = true search.image = true -search.audio = true -search.video = true +search.audio = false +search.video = false search.app = false # number of search results displayed by default diff --git a/htroot/Network.html b/htroot/Network.html index e1717972b..fb01d43cc 100644 --- a/htroot/Network.html +++ b/htroot/Network.html @@ -120,9 +120,9 @@ To see a list of all APIs, please visit the Links RWIs URLs for
Remote Crawl - Sent
Words + Sent
DHT Word Chunks Sent
URLs - Received
Words + Received
DHT Word Chunks Received
URLs Known
Seeds Connects
per hour diff --git a/source/net/yacy/peers/Protocol.java b/source/net/yacy/peers/Protocol.java index 2261c2b15..4b3f8404f 100644 --- a/source/net/yacy/peers/Protocol.java +++ b/source/net/yacy/peers/Protocol.java @@ -1020,6 +1020,7 @@ public final class Protocol { protected static int solrQuery( final SearchEvent event, + final SolrQuery solrQuery, final int offset, final int count, boolean getFacets, @@ -1030,7 +1031,6 @@ public final class Protocol { return -1; // we cannot query solr only with word hashes, there is no clear text string } event.addExpectedRemoteReferences(count); - final SolrQuery solrQuery = event.query.solrQuery(); solrQuery.setStart(offset); solrQuery.setRows(count); diff --git a/source/net/yacy/peers/RemoteSearch.java b/source/net/yacy/peers/RemoteSearch.java index 9d005d5ef..587cd7c76 100644 --- a/source/net/yacy/peers/RemoteSearch.java +++ b/source/net/yacy/peers/RemoteSearch.java @@ -30,6 +30,8 @@ import java.util.List; import java.util.Set; import java.util.SortedMap; +import org.apache.solr.client.solrj.SolrQuery; + import net.yacy.cora.document.ASCII; import net.yacy.cora.storage.HandleSet; import net.yacy.kelondro.logging.Log; @@ -171,8 +173,9 @@ public class RemoteSearch extends Thread { nodePeers.add(event.peers.mySeed()); } if (!Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.DEBUG_SEARCH_REMOTE_SOLR_OFF, false)) { + final SolrQuery solrQuery = event.query.solrQuery(); for (Seed s: nodePeers) { - solrRemoteSearch(event, start, count, s, blacklist); + solrRemoteSearch(event, solrQuery, start, count, s, blacklist); } } @@ -264,6 +267,7 @@ public class RemoteSearch extends Thread { public static Thread solrRemoteSearch( final SearchEvent event, + final SolrQuery solrQuery, final int start, final int count, final Seed targetPeer, @@ -281,6 +285,7 @@ public class RemoteSearch extends Thread { event.oneFeederStarted(); urls = Protocol.solrQuery( event, + solrQuery, start, count, start == 0, diff --git a/source/net/yacy/peers/graphics/Banner.java b/source/net/yacy/peers/graphics/Banner.java index 61a9a33cb..ae9f2116e 100644 --- a/source/net/yacy/peers/graphics/Banner.java +++ b/source/net/yacy/peers/graphics/Banner.java @@ -66,7 +66,7 @@ public final class Banner { private static void drawBannerPicture( final BannerData data, final BufferedImage newLogo) { - final int exprlength = 19; + final int exprlength = 16; logo = newLogo; bannerPicture = new RasterPlotter( @@ -80,17 +80,17 @@ public final class Banner { // draw description bannerPicture.setColor(Long.parseLong(data.getTextcolor(), 16)); - PrintTool.print(bannerPicture, 100, 12, 0, "PEER: " + addTrailingBlanks(data.getName(), exprlength), -1); - PrintTool.print(bannerPicture, 100, 22, 0, "LINKS: " + addBlanksAndDots(data.getLinks(), exprlength), -1); - PrintTool.print(bannerPicture, 100, 32, 0, "WORDS: " + addBlanksAndDots(data.getWords(), exprlength), -1); - PrintTool.print(bannerPicture, 100, 42, 0, "TYPE: " + addTrailingBlanks(data.getType(), exprlength), -1); - PrintTool.print(bannerPicture, 100, 52, 0, "SPEED: " + addTrailingBlanks(data.getPpm() + " PAGES/MINUTE", exprlength), -1); - - PrintTool.print(bannerPicture, 285, 12, 0, "NETWORK: " + addTrailingBlanks(data.getNetwork() + " [" + data.getPeers() + "]", exprlength), -1); - PrintTool.print(bannerPicture, 285, 22, 0, "LINKS: " + addBlanksAndDots(data.getNlinks(), exprlength), -1); - PrintTool.print(bannerPicture, 285, 32, 0, "WORDS: " + addBlanksAndDots(data.getNwords(), exprlength), -1); - PrintTool.print(bannerPicture, 285, 42, 0, "QUERIES: " + addTrailingBlanks(formatQpm(data.getNqph()) + " QUERIES/HOUR", exprlength), -1); - PrintTool.print(bannerPicture, 285, 52, 0, "SPEED: " + addTrailingBlanks(data.getNppm() + " PAGES/MINUTE", exprlength), -1); + PrintTool.print(bannerPicture, 100, 12, 0, "PEER NAME:" + addTrailingBlanks(data.getName(), exprlength), -1); + PrintTool.print(bannerPicture, 100, 22, 0, "DOCUMENTS:" + addBlanksAndDots(data.getLinks(), exprlength), -1); + PrintTool.print(bannerPicture, 100, 32, 0, "DHT WORDS:" + addBlanksAndDots(data.getWords(), exprlength), -1); + PrintTool.print(bannerPicture, 100, 42, 0, "TYPE: " + addTrailingBlanks(data.getType(), exprlength), -1); + PrintTool.print(bannerPicture, 100, 52, 0, "SPEED: " + addTrailingBlanks(data.getPpm() + " PAGES/MINUTE", exprlength), -1); + + PrintTool.print(bannerPicture, 290, 12, 0, "NETWORK: " + addTrailingBlanks(data.getNetwork() + " [" + data.getPeers() + "]", exprlength), -1); + PrintTool.print(bannerPicture, 290, 22, 0, "LINKS: " + addBlanksAndDots(data.getNlinks(), exprlength), -1); + PrintTool.print(bannerPicture, 290, 32, 0, "WORDS: " + addBlanksAndDots(data.getNwords(), exprlength), -1); + PrintTool.print(bannerPicture, 290, 42, 0, "QUERIES: " + addTrailingBlanks(formatQpm(data.getNqph()) + " QUERIES/HOUR", exprlength), -1); + PrintTool.print(bannerPicture, 290, 52, 0, "SPEED: " + addTrailingBlanks(data.getNppm() + " PAGES/MINUTE", exprlength), -1); if (logo != null) { final int x = (100 / 2 - logo.getWidth() / 2); diff --git a/source/net/yacy/search/query/SearchEvent.java b/source/net/yacy/search/query/SearchEvent.java index cf9b4fe95..1ae94deb4 100644 --- a/source/net/yacy/search/query/SearchEvent.java +++ b/source/net/yacy/search/query/SearchEvent.java @@ -259,7 +259,7 @@ public final class SearchEvent { // start a local solr search if (!Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.DEBUG_SEARCH_LOCAL_SOLR_OFF, false)) { - this.localsolrsearch = RemoteSearch.solrRemoteSearch(this, 0, this.query.itemsPerPage, null /*this peer*/, Switchboard.urlBlacklist); + this.localsolrsearch = RemoteSearch.solrRemoteSearch(this, this.query.solrQuery(), 0, this.query.itemsPerPage, null /*this peer*/, Switchboard.urlBlacklist); } this.localsolroffset = this.query.itemsPerPage; @@ -1291,7 +1291,7 @@ public final class SearchEvent { int nextitems = item - this.localsolroffset + this.query.itemsPerPage; // example: suddenly switch to item 60, just 10 had been shown, 20 loaded. if (this.localsolrsearch != null && this.localsolrsearch.isAlive()) {try {this.localsolrsearch.join();} catch (InterruptedException e) {}} if (!Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.DEBUG_SEARCH_LOCAL_SOLR_OFF, false)) { - this.localsolrsearch = RemoteSearch.solrRemoteSearch(this, this.localsolroffset, nextitems, null /*this peer*/, Switchboard.urlBlacklist); + this.localsolrsearch = RemoteSearch.solrRemoteSearch(this, this.query.solrQuery(), this.localsolroffset, nextitems, null /*this peer*/, Switchboard.urlBlacklist); } this.localsolroffset += nextitems; } @@ -1312,7 +1312,7 @@ public final class SearchEvent { if (this.localsolrsearch == null || !this.localsolrsearch.isAlive() && this.local_solr_stored.get() > this.localsolroffset && (item + 1) % this.query.itemsPerPage == 0) { // at the end of a list, trigger a next solr search if (!Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.DEBUG_SEARCH_LOCAL_SOLR_OFF, false)) { - this.localsolrsearch = RemoteSearch.solrRemoteSearch(this, this.localsolroffset, this.query.itemsPerPage, null /*this peer*/, Switchboard.urlBlacklist); + this.localsolrsearch = RemoteSearch.solrRemoteSearch(this, this.query.solrQuery(), this.localsolroffset, this.query.itemsPerPage, null /*this peer*/, Switchboard.urlBlacklist); } this.localsolroffset += this.query.itemsPerPage; }