Apache Lucene open-source search software
SOLR-6657: DocumentDictionaryFactory requires weightField to be mandatory, but it shouldn't
Erick Erickson3ae3d32bcb67
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 8c8f8d53a5b..9441bb610d3 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -175,6 +175,9 @@ Bug Fixes* SOLR-7171: BaseDistributedSearchTestCase now clones getSolrHome() for each subclass,and consistently uses getSolrXml(). (hossman)+* SOLR-6657: DocumentDictionaryFactory requires weightField to be mandatory, but it shouldn't+ (Erick Erickson)+Optimizations----------------------diff --git a/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentDictionaryFactory.java b/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentDictionaryFactory.javaindex 7a2f8f4dd71..8de907a5208 100644--- a/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentDictionaryFactory.java+++ b/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentDictionaryFactory.java@@ -46,10 +46,7 @@ public class DocumentDictionaryFactory extends DictionaryFactory {if (field == null) {throw new IllegalArgumentException(FIELD + " is a mandatory parameter");}- if (weightField == null) {- throw new IllegalArgumentException(WEIGHT_FIELD + " is a mandatory parameter");- }-+return new DocumentDictionary(searcher.getIndexReader(), field, weightField, payloadField);}