Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixed computation of links in host browser which are not indexed but knwon by the crawler. Such links are now displayed in grey color.
Michael Peter Christenc4a3d8870ff7
diff --git a/htroot/HostBrowser.html b/htroot/HostBrowser.htmlindex 051403ae6..d53a202b0 100644--- a/htroot/HostBrowser.html+++ b/htroot/HostBrowser.html@@ -85,18 +85,18 @@ function updatepage(str) {#(/hosts)##(files)#::- <fieldset><legend>Files in #[path]#</legend>- <p>Documents in domain: #[hostsize]#; Documents in subpath: #[subpathsize]#</p>+ <fieldset><legend>Browser for #[path]#</legend>+ <p>Documents on host: #[hostsize]#; Documents in subpath: #[subpathsize]#</p><table border="0" cellpadding="2" cellspacing="2" style="float:left"><tr><th align="center" width="32"></th>- <th align="left" width="600">Path</th>- <th align="right" width="80" >Documents</th>+ <th align="left" width="600" class="listing">Path</th>+ <th align="right" width="80" class="listing">Documents</th></tr>#(root)#<tr class="TableCell#(dark)#Light::Dark::Summary#(/dark)#"><td align="center"></td>- <td align="left" nowrap ><a href="/HostBrowser.html?path=#[path]#">..</a></td>+ <td align="left" nowrap ><a href="/HostBrowser.html?path=#[path]#" class="listing">..</a></td><td align="right" nowrap></td></tr>::#(/root)#@@ -104,11 +104,11 @@ function updatepage(str) {#(type)#<tr class="TableCell#(dark)#Light::Dark::Summary#(/dark)#"><td align="center"><a href="/ViewFile.html?url=#[file]#"><img src="/env/grafics/doc.gif"/></a></td>- <td align="left" nowrap #(stored)#class="error"::#(/stored)# colspan="2">#[file]# <a href="#[file]#"><img src="/env/grafics/link.gif"/></a></td>+ <td align="left" nowrap class=#(stored)#"listingem"::"listing"#(/stored)# colspan="2">#[file]# <a href="#[file]#"><img src="/env/grafics/link.gif"/></a></td></tr>::<tr class="TableCell#(dark)#Light::Dark::Summary#(/dark)#"><td align="center"><img src="/env/grafics/dir.gif"/></td>- <td align="left" nowrap ><a href="/HostBrowser.html?path=#[file]#">#[file]#</a></td>+ <td align="left" nowrap class="listing"><a href="/HostBrowser.html?path=#[file]#" class="listing">#[file]#</a></td><td align="right" nowrap>#[count]#</td></tr>#(/type)#diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.javaindex ab4f68784..57854b358 100644--- a/htroot/HostBrowser.java+++ b/htroot/HostBrowser.java@@ -39,6 +39,7 @@ import net.yacy.cora.sorting.ReversibleScoreMap;import net.yacy.kelondro.logging.Log;import net.yacy.search.Switchboard;import net.yacy.search.index.Fulltext;+import net.yacy.search.index.SolrConfiguration;import net.yacy.server.serverObjects;import net.yacy.server.serverSwitch;@@ -124,8 +125,8 @@ public class HostBrowser {String u = (String) doc.getFieldValue(YaCySchema.sku.name());hostsize++;if (u.startsWith(path)) storedDocs.add(u);- Collection<Object> urlprot = doc.getFieldValues(YaCySchema.inboundlinks_protocol_sxt.name());Collection<Object> urlstub = doc.getFieldValues(YaCySchema.inboundlinks_urlstub_txt.name());+ Collection<String> urlprot = urlstub == null ? null : SolrConfiguration.indexedList2protocolList(doc.getFieldValues(YaCySchema.inboundlinks_protocol_sxt.name()), urlstub.size());if (urlprot != null && urlstub != null) {assert urlprot.size() == urlstub.size();Object[] urlprota = urlprot.toArray();diff --git a/htroot/env/base.css b/htroot/env/base.cssindex 3561a460c..3a22fcc7c 100644--- a/htroot/env/base.css+++ b/htroot/env/base.css@@ -150,6 +150,16 @@ tt, *.tt {display:hidden;}+.listing {+ font-family:Courier,Terminal,sans-serif;+ color:black;+}++.listingem {+ font-family:Courier,Terminal,sans-serif;+ color:DimGray;+}+/* .snippetLoaded {font-style:italic;color: #666;diff --git a/source/net/yacy/search/index/SolrConfiguration.java b/source/net/yacy/search/index/SolrConfiguration.javaindex fd8ded0ac..ec9290541 100644--- a/source/net/yacy/search/index/SolrConfiguration.java+++ b/source/net/yacy/search/index/SolrConfiguration.java@@ -775,6 +775,15 @@ public class SolrConfiguration extends ConfigurationSet implements Serializablereturn doc;}+ /**+ * this method compresses a list of protocol names to an indexed list.+ * To do this, all 'http' entries are removed and considered as default.+ * The remaining entries are indexed as follows: a list of <i>-<p> entries is produced, where+ * <i> is an index pointing to the original index of the protocol entry and <p> is the protocol entry itself.+ * The <i> entry is formatted as a 3-digit decimal number with leading zero digits.+ * @param protocol+ * @return a list of indexed protocol entries+ */private static List<String> protocolList2indexedList(List<String> protocol) {List<String> a = new ArrayList<String>();String p;@@ -788,7 +797,15 @@ public class SolrConfiguration extends ConfigurationSet implements Serializable}return a;}-++ public static List<String> indexedList2protocolList(Collection<Object> iplist, int dimension) {+ List<String> a = new ArrayList<String>(dimension);+ for (int i = 0; i < dimension; i++) a.add("http");+ if (iplist == null) return a;+ for (Object ip: iplist) a.set(Integer.parseInt(((String) ip).substring(0, 3)), ((String) ip).substring(4));+ return a;+ }+/*** encode a string containing attributes from anchor rel properties binary:* bit 0: "me" contained in rel