SOLR-9193: Fix conflict between parameters of TermsComponent and json facet API

This commit is contained in:
jbernste 2016-07-05 00:48:16 -04:00
parent 360c4da90b
commit ad8b22d0b2
1 changed files with 6 additions and 2 deletions

View File

@ -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);