From a460addd2f9511432da7684bd2ee6598025389ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Mon, 30 May 2016 10:24:23 +0200 Subject: [PATCH] SOLR-8583: Do not attempt highlight of alternate if it is same as original hl field (cherry picked from commit 05ce40a) --- .../java/org/apache/solr/highlight/DefaultSolrHighlighter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java b/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java index 08ae03769fe..9941b16ea60 100644 --- a/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java +++ b/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java @@ -678,7 +678,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf return null; } - if (params.getFieldBool(fieldName, HighlightParams.HIGHLIGHT_ALTERNATE, true)) { + if (params.getFieldBool(fieldName, HighlightParams.HIGHLIGHT_ALTERNATE, true) && !alternateField.equals(fieldName)) { // Try to highlight alternate field Object fieldHighlights = null; SchemaField schemaField = schema.getFieldOrNull(alternateField);