Source:
List<NameValuePair> buildParameters() { List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("wt", "json")); String docType = isPartialSearch ? "partial" : "full"; params.add(new BasicNameValuePair("fq", "doc_type:" + docType)); params.add(new BasicNameValuePair("fq", "!article_type_facet:\"Issue Image\"")); for (String filterQuery : filterQueries) { params.add(new BasicNameValuePair("fq", filterQuery)); } if (start > 0) { params.add(new BasicNameValuePair("start", Integer.toString(start))); } params.add(new BasicNameValuePair("rows", Integer.toString(rows))); params.add(new BasicNameValuePair("hl", "false")); String queryString = query.or("*:*"); if (isPartialSearch) { params.add(new BasicNameValuePair("qf", "doc_partial_body")); params.add(new BasicNameValuePair("fl", "*")); } params.add(new BasicNameValuePair("q", queryString)); if (query.isPresent() && isSimple) { params.add(new BasicNameValuePair("defType", "dismax")); } if (facet.isPresent()) { params.add(new BasicNameValuePair("facet", "true")); params.add(new BasicNameValuePair("facet.field", facet.get())); params.add(new BasicNameValuePair("facet.mincount", Integer.toString(MIN_FACET_COUNT))); params.add(new BasicNameValuePair("facet.limit", Integer.toString(MAX_FACET_SIZE))); params.add(new BasicNameValuePair("json.nl", "map")); } else { params.add(new BasicNameValuePair("facet", "false")); params.add(new BasicNameValuePair("fl", ARTICLE_FIELDS)); } setQueryFilters(params); for (Map.Entry<String, String> entry : rawParameters.entrySet()) { params.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); } return params; }

Target:
List<NameValuePair> buildParameters() { List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("wt", "json")); if (isPartialSearch) { params.add(new BasicNameValuePair("qf", "doc_partial_body")); params.add(new BasicNameValuePair("fl", "*")); params.add(new BasicNameValuePair("fq", "doc_type:partial")); } else { params.add(new BasicNameValuePair("fq", "doc_type:full")); } params.add(new BasicNameValuePair("fq", "!article_type_facet:\"Issue Image\"")); for (String filterQuery : filterQueries) { params.add(new BasicNameValuePair("fq", filterQuery)); } if (start > 0) { params.add(new BasicNameValuePair("start", Integer.toString(start))); } params.add(new BasicNameValuePair("rows", Integer.toString(rows))); params.add(new BasicNameValuePair("hl", "false")); String queryString = query.or("*:*"); params.add(new BasicNameValuePair("q", queryString)); if (query.isPresent() && isSimple) { params.add(new BasicNameValuePair("defType", "dismax")); } if (facet.isPresent()) { params.add(new BasicNameValuePair("facet", "true")); params.add(new BasicNameValuePair("facet.field", facet.get())); params.add(new BasicNameValuePair("facet.mincount", Integer.toString(MIN_FACET_COUNT))); params.add(new BasicNameValuePair("facet.limit", Integer.toString(MAX_FACET_SIZE))); params.add(new BasicNameValuePair("json.nl", "map")); } else { params.add(new BasicNameValuePair("facet", "false")); params.add(new BasicNameValuePair("fl", ARTICLE_FIELDS)); } setQueryFilters(params); for (Map.Entry<String, String> entry : rawParameters.entrySet()) { params.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); } return params; }