Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added solr field 'refresh_s' which stores the refresh url contained in the meta-refresh html header field.
Michael Peter Christen508a81b86ca2
diff --git a/defaults/solr.keys.list b/defaults/solr.keys.listindex 3394a7fd6..05fde7e4a 100644--- a/defaults/solr.keys.list+++ b/defaults/solr.keys.list@@ -184,6 +184,9 @@ host_s## url inside the canonical link element, stringcanonical_s+## link from the url property inside the refresh link element, string+refresh_s+## all texts in <li> tags, textgenli_txtdiff --git a/source/net/yacy/document/parser/html/ContentScraper.java b/source/net/yacy/document/parser/html/ContentScraper.javaindex 4b4618598..3ddd7859d 100644--- a/source/net/yacy/document/parser/html/ContentScraper.java+++ b/source/net/yacy/document/parser/html/ContentScraper.java@@ -807,7 +807,7 @@ public class ContentScraper extends AbstractScraper implements Scraper {final int pos = s.indexOf(';');if (pos < 0) return EMPTY_STRING;- s = s.substring(pos + 1);+ s = s.substring(pos + 1).trim();if (s.toLowerCase().startsWith("url=")) return s.substring(4).trim();return EMPTY_STRING;}diff --git a/source/net/yacy/search/index/SolrConfiguration.java b/source/net/yacy/search/index/SolrConfiguration.javaindex 59179ac4f..fab3e4a68 100644--- a/source/net/yacy/search/index/SolrConfiguration.java+++ b/source/net/yacy/search/index/SolrConfiguration.java@@ -354,6 +354,24 @@ public class SolrConfiguration extends ConfigurationSet implements Serializable}}+ // meta refresh tag+ if (isEmpty() || contains(SolrField.refresh_s.name())) {+ String refresh = html.getRefreshPath();+ if (refresh != null && refresh.length() > 0) {+ MultiProtocolURI refreshURL;+ try {+ refreshURL = refresh.startsWith("http") ? new MultiProtocolURI(html.getRefreshPath()) : new MultiProtocolURI(digestURI, html.getRefreshPath());+ if (refreshURL != null) {+ inboundLinks.remove(refreshURL);+ ouboundLinks.remove(refreshURL);+ addSolr(solrdoc, SolrField.refresh_s, refreshURL.toNormalform(false, false));+ }+ } catch (MalformedURLException e) {+ addSolr(solrdoc, SolrField.refresh_s, refresh);+ }+ }+ }+// flash embeddedif (isEmpty() || contains(SolrField.flash_b.name())) {MultiProtocolURI[] flashURLs = html.getFlash();diff --git a/source/net/yacy/search/index/SolrField.java b/source/net/yacy/search/index/SolrField.javaindex 77713800c..3fcbfd721 100644--- a/source/net/yacy/search/index/SolrField.java+++ b/source/net/yacy/search/index/SolrField.java@@ -82,6 +82,7 @@ public enum SolrField implements net.yacy.cora.services.federated.solr.SolrFieldh6_txt(SolrType.text_general, true, true, true, "h6 header"),htags_i(SolrType.integer, true, true, "binary pattern for the existance of h1..h6 headlines"),canonical_s(SolrType.string, true, true, "url inside the canonical link element"),+ refresh_s(SolrType.string, true, true, "link from the url property inside the refresh link element"),metagenerator_t(SolrType.text_general, true, true, "content of <meta name=\"generator\" content=#content#> tag"),boldcount_i(SolrType.integer, true, true, "total number of occurrences of <b> or <strong>"),bold_txt(SolrType.text_general, true, true, true, "all texts inside of <b> or <strong> tags. no doubles. listed in the order of number of occurrences in decreasing order"),@@ -150,6 +151,7 @@ public enum SolrField implements net.yacy.cora.services.federated.solr.SolrField* Returns the YaCy default or (if available) custom field name for Solr* @return SolrFieldname String*/+ @Overridepublic final String getSolrFieldName() {return (this.solrFieldName == null ? this.name() : this.solrFieldName);}@@ -167,26 +169,32 @@ public enum SolrField implements net.yacy.cora.services.federated.solr.SolrField}}+ @Overridepublic final SolrType getType() {return this.type;}+ @Overridepublic final boolean isIndexed() {return this.indexed;}+ @Overridepublic final boolean isStored() {return this.stored;}+ @Overridepublic final boolean isMultiValued() {return this.multiValued;}+ @Overridepublic final boolean isOmitNorms() {return this.omitNorms;}+ @Overridepublic final String getComment() {return this.comment;}