if(lon != null) params.put("lon", lon);
if(lat != null) params.put("lat", lat);
StrSubstitutor sub = new StrSubstitutor(params.build(), "${", "}");
if(lon != null && lat != null) {
query = sub.replace(queryLocationBiasTemplate);
} else {
query = sub.replace(queryTemplate);
}
SearchResponse response = client.prepareSearch("photon").setSearchType(SearchType.QUERY_AND_FETCH).setQuery(query).setSize(limit).setTimeout(TimeValue.timeValueSeconds(7)).execute().actionGet();