mirror of https://github.com/apache/lucene.git
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:
parent
5bfe7bff4c
commit
78ec5a3699
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue