From 1f497ccad54de1e366577f28cbb4ce8230b5566d Mon Sep 17 00:00:00 2001 From: reger Date: Sat, 28 Jan 2017 00:36:03 +0100 Subject: [PATCH 1/2] Add consistency check for related index fields upon load and save of index schema. To assemble the original link url for out-/inboundlinks, icons and pictures the *_protocol_sxt and *_urlstub_sxt is needed (due to the used data-reduced storage methode). Auto-enable *_protocol_sxt if *_urlstub_sxt is enabled. to be able to correctly assemble the original link url. --- .../schema/CollectionConfiguration.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/source/net/yacy/search/schema/CollectionConfiguration.java b/source/net/yacy/search/schema/CollectionConfiguration.java index 93074d9b0..7bc87e09e 100644 --- a/source/net/yacy/search/schema/CollectionConfiguration.java +++ b/source/net/yacy/search/schema/CollectionConfiguration.java @@ -150,6 +150,38 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri ConcurrentLog.warn("SolrCollectionWriter", " solr schema file " + configurationFile.getAbsolutePath() + " is missing declaration for '" + field.name() + "'"); } } + checkFieldRelationConsistency(); + } + + /** + * Check and update schema configuration with required related fields. + * If a specific field is enabled, there might be a other field internal + * processes rely on. Enable these required fields. + * For example, the outboundlinks are split into protocol and url part. The + * correct original url can only be assembled if both fields are available (protocol + url = originalUrl) + */ + private void checkFieldRelationConsistency() { + Entry e; + // for correct assembly of outboundlinks outboundlinks_protocol_sxt + outboundlinks_urlstub_sxt is needed + if (this.contains(CollectionSchema.outboundlinks_urlstub_sxt) && !this.contains(CollectionSchema.outboundlinks_protocol_sxt)) { + e = new Entry(CollectionSchema.outboundlinks_protocol_sxt.name(), CollectionSchema.outboundlinks_protocol_sxt.getSolrFieldName(), true); + this.put(CollectionSchema.outboundlinks_protocol_sxt.name(), e); + } + // for correct assembly of inboundlinks inboundlinks_protocol_sxt + inboundlinks_urlstub_sxt is needed + if (this.contains(CollectionSchema.inboundlinks_urlstub_sxt) && !this.contains(CollectionSchema.inboundlinks_protocol_sxt)) { + e = new Entry(CollectionSchema.inboundlinks_protocol_sxt.name(), CollectionSchema.inboundlinks_protocol_sxt.getSolrFieldName(), true); + this.put(CollectionSchema.inboundlinks_protocol_sxt.name(), e); + } + // for correct assembly of icon url icons_protocol_sxt + icons_urlstub_sxt is needed + if (this.contains(CollectionSchema.icons_urlstub_sxt) && !this.contains(CollectionSchema.icons_protocol_sxt)) { + e = new Entry(CollectionSchema.icons_protocol_sxt.name(), CollectionSchema.icons_protocol_sxt.getSolrFieldName(), true); + this.put(CollectionSchema.icons_protocol_sxt.name(), e); + } + // for correct assembly of image url images_protocol_sxt + images_urlstub_sxt is needed + if (this.contains(CollectionSchema.images_urlstub_sxt) && !this.contains(CollectionSchema.images_protocol_sxt)) { + e = new Entry(CollectionSchema.images_protocol_sxt.name(), CollectionSchema.images_protocol_sxt.getSolrFieldName(), true); + this.put(CollectionSchema.images_protocol_sxt.name(), e); + } } public String[] allFields() { @@ -183,6 +215,7 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri */ @Override public void commit() throws IOException { + checkFieldRelationConsistency(); // in case of changes, check related fields are enabled before save try { super.commit(); // make sure the enum SolrField.SolrFieldName is current From 8ce8e23e7d588e3c8d9318e566781224cf6d0b52 Mon Sep 17 00:00:00 2001 From: reger Date: Sat, 28 Jan 2017 01:13:57 +0100 Subject: [PATCH 2/2] Update language file de & master, remove obsolete "Augmented Browsing" --- locales/de.lng | 8 -------- locales/master.lng.xlf | 12 ------------ 2 files changed, 20 deletions(-) diff --git a/locales/de.lng b/locales/de.lng index a1006c368..5784a6fec 100644 --- a/locales/de.lng +++ b/locales/de.lng @@ -82,7 +82,6 @@ This is a list of searches that had been requested from remote peer search inter #File: Settings_UrlProxyAccess.inc #--------------------------- -Augmented Browsing<==Angereichertes Browsen< URL Proxy Settings<==URL Proxy Einstellungen< With this settings you can activate or deactivate URL proxy.==Mit diesen Einstellungen können Sie den URL Proxy an- oder abschalten. Service call: ==Serviceaufruf: @@ -97,9 +96,7 @@ Define client filter. Default: ==Definiere den Client Filter. Standardeinstellun URL substitution:==Ersetzen von URLs: Define URL substitution rules which allow navigating in proxy environment. Possible values: all, domainlist. Default: domainlist.==Definiere die Regeln zum Ersetzen von URLs die Navigation in der Proxy Umgebung erlauben. Mögliche Werte: all, domainlist. Standardeinstellung: domainlist. "Submit"=="Absenden" -Augmented Browsing Settings==Angereicherte Browser Einstellungen #>Enabled<==>Aktiviert< -Enables or disables augmented browsing. If enabled, all websites will be modified during loading.==Schaltet angereichertes Browsing an oder ab. Wenn aktiviert werden alle Webseite während des Ladens modifiziert. #----------------------------- #File: Autocrawl_p.html @@ -881,7 +878,6 @@ http://url-of-the-search-result.net==http://URL-des-Suchergebnisses.de #>Citation<==>Citation< >Pictures<==>Bilder< #>Cache<==>Cache< ->Augmented Browsing<==>Angereichertes Browsen< "Save Settings"=="Einstellungen Speichern" "Set Default Values"=="Setze Standardwerte" #----------------------------- @@ -4042,10 +4038,6 @@ Content Semantic==Inhalt Semantik >Automated Annotation<==>Automatische Annotation< Auto-Annotation Vocabulary Editor==Auto-Annotation Vokabellisten Editor Knowledge Loader==Wissensdatenbank-Lader -# Submenu Augmented Content ->Augmented Content<==>Angereicherter Inhalt< -Augmented Browsing==Angereichertes Browsing -Filters and Modules==Filter und Module #----------------------------- #File: env/templates/submenuTargetAnalysis.template diff --git a/locales/master.lng.xlf b/locales/master.lng.xlf index 7a3c4a531..68151428f 100644 --- a/locales/master.lng.xlf +++ b/locales/master.lng.xlf @@ -133,9 +133,6 @@ - - Augmented Browsing< - URL Proxy Settings< @@ -2123,9 +2120,6 @@ >Cache< - - >Augmented Browsing< - For this option URL proxy must be enabled. @@ -10485,12 +10479,6 @@ Knowledge Loader - - >Augmented Content< - - - Augmented Browsing -