The code below is failing with an error. (Park is a valid document type) ... Looks like the argument type is is not being quoted...
{"message":"[function geopoint.near(..)] unexpected field 'Park' on line:1 col:22 in query '[[:d = geopoint.near(Park, -37.17130121230986, -38.923238754141494, 3)]]'\n[[:d = geopoint.near(Park, -37.17130121230986, -38.923238754141494, 3)]]\n ^\n","type":"parsing-error","line":1,"column":22,"id":0,"location":"query"}
public static List<Document> findAllByGeoCodeAndRadiusMiles(String type, GeoPoint p, Integer radius, int max) {
List<Document> documents = new ArrayList<Document>();
if (p != null) {
Form.SearchForm f = getApi().query(Predicates.near(type, p.getLatitude(), p.getLongitude(), radius));
f.pageSize(max);
Response response = f.submit();
documents = response.getResults();
}
return documents;
}