From 929c88c78f84b0671f743bf3c29c9c9d2a9637e7 Mon Sep 17 00:00:00 2001 From: Joel Bernstein Date: Fri, 25 Oct 2013 02:50:34 +0000 Subject: [PATCH] SOLR-5027: Added error handling to CollapsingQParserPlugin git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1535614 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/solr/search/CollapsingQParserPlugin.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java index 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."); } }