You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/01/11 08:00:42 UTC

[06/50] [abbrv] lucene-solr:jira/solr-11702: SOLR-11798: Formally deprecate top-level syntax in solrconfig.xml in favour of equivalent syntax.

SOLR-11798: Formally deprecate top-level <highlighting> syntax in solrconfig.xml in favour of <searchComponent> equivalent syntax.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5d4f029f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5d4f029f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5d4f029f

Branch: refs/heads/jira/solr-11702
Commit: 5d4f029fdd0b916d631d2432e4fd0216c91c8703
Parents: 8fd7ead
Author: Christine Poerschke <cp...@apache.org>
Authored: Thu Jan 4 13:04:30 2018 +0000
Committer: Christine Poerschke <cp...@apache.org>
Committed: Thu Jan 4 14:54:47 2018 +0000

----------------------------------------------------------------------
 solr/CHANGES.txt                                              | 6 ++++++
 .../org/apache/solr/handler/component/HighlightComponent.java | 7 +++++++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5d4f029f/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index d30015e..7137b80 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -57,6 +57,9 @@ Upgrade Notes
   Autoscaling API which is now a no-op. Use the 'triggerCooldownPeriodSeconds' instead to pause event
   processing.
 
+* SOLR-11798: The top-level <highlighting> syntax in solrconfig.xml is now formally
+  deprecated in favour of <searchComponent> equivalent syntax. See also SOLR-1696.
+
 New Features
 ----------------------
 * SOLR-11285: Simulation framework for autoscaling. (ab)
@@ -107,6 +110,9 @@ Other Changes
 
 * SOLR-11805: SolrJ's SolrResponse.getElaspedTime was sometimes a millisecond off. (David Smiley)
 
+* SOLR-11798: Formally deprecate top-level <highlighting> syntax in solrconfig.xml
+  in favour of <searchComponent> equivalent syntax. (Christine Poerschke)
+
 ==================  7.2.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5d4f029f/solr/core/src/java/org/apache/solr/handler/component/HighlightComponent.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/component/HighlightComponent.java b/solr/core/src/java/org/apache/solr/handler/component/HighlightComponent.java
index f1c9680..698cc05 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/HighlightComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/HighlightComponent.java
@@ -25,6 +25,7 @@ import java.util.stream.Stream;
 
 import com.google.common.base.Objects;
 import org.apache.lucene.search.Query;
+import org.apache.lucene.util.Version;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.HighlightParams;
 import org.apache.solr.common.params.SolrParams;
@@ -46,6 +47,7 @@ import org.apache.solr.util.plugin.PluginInfoInitialized;
 import org.apache.solr.util.plugin.SolrCoreAware;
 
 import static java.util.stream.Collectors.toMap;
+import static org.apache.solr.core.Config.assertWarnOrFail;
 
 /**
  * TODO!
@@ -131,6 +133,11 @@ public class HighlightComponent extends SearchComponent implements PluginInfoIni
     List<PluginInfo> children = info.getChildren("highlighting");
     if(children.isEmpty()) {
       PluginInfo pluginInfo = core.getSolrConfig().getPluginInfo(SolrHighlighter.class.getName()); //TODO deprecated configuration remove later
+      assertWarnOrFail("solrconfig.xml <highlighting> configuration is deprecated since SOLR-1696 "
+              + "and no longer supported from Solr 7.3 onwards. "
+              + "Please configure via <searchComponent> instead.",
+          (null == pluginInfo),
+          core.getSolrConfig().luceneMatchVersion.onOrAfter(Version.LUCENE_7_3_0));
       if (pluginInfo != null) {
         solrConfigHighlighter = core.createInitInstance(pluginInfo, SolrHighlighter.class, null, DefaultSolrHighlighter.class.getName());
       } else {