From ad8b22d0b2a05425fbd51bd01ddb621a1ebe98b4 Mon Sep 17 00:00:00 2001 From: jbernste Date: Tue, 5 Jul 2016 00:48:16 -0400 Subject: [PATCH] SOLR-9193: Fix conflict between parameters of TermsComponent and json facet API --- .../org/apache/solr/handler/component/TermsComponent.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java b/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java index daf5b5b852e..076c4eb1575 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java @@ -65,7 +65,9 @@ public class TermsComponent extends SearchComponent { @Override public void prepare(ResponseBuilder rb) throws IOException { SolrParams params = rb.req.getParams(); - if (params.getBool(TermsParams.TERMS, false)) { + + //the terms parameter is also used by json facet API. So we will get errors if we try to parse as boolean + if (params.get(TermsParams.TERMS, "false").equals("true")) { rb.doTerms = true; } else { return; @@ -86,7 +88,9 @@ public class TermsComponent extends SearchComponent { @Override public void process(ResponseBuilder rb) throws IOException { SolrParams params = rb.req.getParams(); - if (!params.getBool(TermsParams.TERMS, false)) return; + if (!params.get(TermsParams.TERMS, "false").equals("true")) { + return; + } String[] fields = params.getParams(TermsParams.TERMS_FIELD);