{
if (query == null) return;
try
{
JSONObject jsonObj = new FastJSONObject(query.toString());
Iterator iter = jsonObj.keys();
final String format = "%s:%s";
while (iter.hasNext()) {
String key = (String) iter.next();
if (key.equals("query")) {
qparams.add(new BasicNameValuePair(SenseiSearchServletParams.PARAM_QUERY, jsonObj.get(key).toString()));
continue;
}
qparams.add(new BasicNameValuePair(SenseiSearchServletParams.PARAM_QUERY_PARAM, String.format(format, key, jsonObj.get(key))));
}
}
catch (JSONException e)
{
throw new SenseiException(e);