SearchControls controls = new SearchControls();
int n = parameters.length;
for(int i=0; i<n; i++) {
Any property = parameters[i];
if (property.isMap()) {
AnyMap map = property.toMap();
String key = map.getLeft().toString();
if (key.equalsIgnoreCase("scope")) {
controls.setSearchScope(map.getRight().toInt());
} else if (key.equalsIgnoreCase("countlimit")) {
controls.setCountLimit(map.getRight().toInt());