From 78ec5a3699f8b724e90eadbf48a6cef1aa12dca0 Mon Sep 17 00:00:00 2001 From: Mike Klaas Date: Mon, 14 Jan 2008 23:18:00 +0000 Subject: [PATCH] SOLR-444: do not highlight default search field if none present git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@611967 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/solr/highlight/SolrHighlighter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/solr/highlight/SolrHighlighter.java b/src/java/org/apache/solr/highlight/SolrHighlighter.java index e5ab09ed624..6ceedd63f60 100644 --- a/src/java/org/apache/solr/highlight/SolrHighlighter.java +++ b/src/java/org/apache/solr/highlight/SolrHighlighter.java @@ -159,7 +159,8 @@ public class SolrHighlighter if(emptyArray(fields)) { // use default search field if highlight fieldlist not specified. if (emptyArray(defaultFields)) { - fields = new String[]{request.getSchema().getDefaultSearchFieldName()}; + String defaultSearchField = request.getSchema().getDefaultSearchFieldName(); + fields = null == defaultSearchField ? new String[]{} : new String[]{defaultSearchField}; } else { fields = defaultFields;