mirror of https://github.com/apache/lucene.git
SOLR-8583: Do not attempt highlight of alternate if it is same as original hl field
(cherry picked from commit 05ce40a
)
This commit is contained in:
parent
3a74daab20
commit
a460addd2f
|
@ -678,7 +678,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
|
||||||
return null;
|
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
|
// Try to highlight alternate field
|
||||||
Object fieldHighlights = null;
|
Object fieldHighlights = null;
|
||||||
SchemaField schemaField = schema.getFieldOrNull(alternateField);
|
SchemaField schemaField = schema.getFieldOrNull(alternateField);
|
||||||
|
|
Loading…
Reference in New Issue