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
This commit is contained in:
Mike Klaas 2008-01-14 23:18:00 +00:00
parent 5bfe7bff4c
commit 78ec5a3699
1 changed files with 2 additions and 1 deletions

View File

@ -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;