Apache Lucene open-source search software
SOLR-5027: Added error handling to CollapsingQParserPlugin
Joel Bernstein929c88c78f84
diff --git a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.javaindex 716fea79e47..22d2f853ef4 100644--- a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java+++ b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java@@ -188,6 +188,8 @@ public class CollapsingQParserPlugin extends QParserPlugin {this.nullPolicy = NULL_POLICY_COLLAPSE;} else if(nPolicy.equals((NULL_EXPAND))) {this.nullPolicy = NULL_POLICY_EXPAND;+ } else {+ throw new IOException("Invalid nullPolicy:"+nPolicy);}this.searcher = request.getSearcher();this.leafCount = searcher.getTopReaderContext().leaves().size();@@ -516,6 +518,8 @@ public class CollapsingQParserPlugin extends QParserPlugin {this.fieldValueCollapse = new LongValueCollapse(searcher, field, nullPolicy, new int[valueCount], max, this.needsScores, boostDocs);} else if(fieldType instanceof TrieFloatField) {this.fieldValueCollapse = new FloatValueCollapse(searcher, field, nullPolicy, new int[valueCount], max, this.needsScores, boostDocs);+ } else {+ throw new IOException("min/max must be either TrieInt, TrieLong or TrieFloat.");}}