{
final String format = "%s.%s.%s.%s";
for (Entry<String,FacetHandlerInitializerParam> entry : initParams.entrySet()) {
String facetName = entry.getKey();
FacetHandlerInitializerParam param = entry.getValue();
for (String paramName : param.getBooleanParamNames()) {
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE ),
SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_BOOL));
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
join(param.getBooleanParam(paramName), ",")));
}
for (String paramName : param.getByteArrayParamNames()) {
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE),
SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_BYTEARRAY));
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
new String(param.getByteArrayParam(paramName), "UTF-8")));
}
for (String paramName : param.getDoubleParamNames()) {
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE),
SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_DOUBLE));
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
join(param.getDoubleParam(paramName), ",")));
}
for (String paramName : param.getIntParamNames()) {
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE),
SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_INT));
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
join(param.getIntParam(paramName), ",")));
}
for (String paramName : param.getLongParamNames()) {
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE),
SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_LONG));
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
join(param.getLongParam(paramName), ",")));
}
for (String paramName : param.getStringParamNames()) {
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE),
SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_STRING));
qparams.add(new BasicNameValuePair(
String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
join(param.getStringParam(paramName), ",")));
}
}
}