gus-asf commented on code in PR #2379: URL: https://github.com/apache/solr/pull/2379#discussion_r1548491748
########## solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java: ########## @@ -118,12 +122,27 @@ public interface ShardParams { * <p>By default, returns <code>false</code> when {@value #SHARDS_TOLERANT} is not set in <code> * params</code>. */ - static boolean getShardsTolerantAsBool(SolrParams params) { - String shardsTolerantValue = params.get(SHARDS_TOLERANT); + static boolean getShardsTolerantAsBool(RequestParamsSupplier req) { + String shardsTolerantValue = req.getParams().get(SHARDS_TOLERANT); if (null == shardsTolerantValue || shardsTolerantValue.equals(REQUIRE_ZK_CONNECTED)) { return false; } else { - return StrUtils.parseBool(shardsTolerantValue); // throw an exception if non-boolean + boolean tolerant = StrUtils.parseBool(shardsTolerantValue); + if (tolerant && req.shouldDiscardPartials()) { + throw new SolrException( + SolrException.ErrorCode.BAD_REQUEST, + "Use of " + + SHARDS_TOLERANT + + " requires that " + + ALLOW_PARTIAL_RESULTS + + " is true. If " + + ALLOW_PARTIAL_RESULTS + + " is defaulted to true for this handler or system wide, explicitly" + + "passing " + + ALLOW_PARTIAL_RESULTS + + "=true will allow shards.tolerant to work"); Review Comment: oops, yeah s/true/false there. That's a typo from rewriting it six times :), also you're right it probably is givign too much detail... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org