code: public List<Toponym> search(String q, int maxRows, boolean fuzzy) throws Exception {
  		List<Toponym> searchResult = new ArrayList<Toponym>();
  
  		String url = "q=" + URLEncoder.encode(q, "UTF8");
  		url += "&isNameRequired=true";
  		if (fuzzy) {
  			url += "&fuzzy=" + FUZZY_VALUE;
  		}
  		if (maxRows > 0) {
  			url += "&maxRows=" + maxRows;
  		}
  		url += "&style=" + Style.SHORT;
  		if (null != userName) {
  			url += "&username=" + userName;
  		}
  
  		InputStream inputStream = connect(url);
  		if (null != inputStream) {
  			SAXBuilder parser = new SAXBuilder();
  			Document doc = parser.build(connect(url));
  
  			Element root = doc.getRootElement();
  
  			// check for exception
  			Element message = root.getChild("status");
  			if (message != null) {
  				throw new Exception(message.getAttributeValue("message"));
  			}
  
  			for (Object obj : root.getChildren("geoname")) {
  				Element toponymElement = (Element) obj;
  				Toponym toponym = getToponymFromElement(toponymElement);
  				searchResult.add(toponym);
  			}
  		}
  		return searchResult;
  	}
docs: Full text search on the GeoNames database. Modified version from the geonames library to allow using
  isNameRequired and fuzzy.
  <p/>
  This service gets the number of toponyms defined by the 'maxRows' parameter. The parameter 'style' determines
  which fields are returned by the service.
  
  @param q search string
  @param maxRows max number of rows in result, or 0 for all
  @param fuzzy should search be fuzzy?
  @return list of found toponyms
  @throws Exception oops
  @see <a href="http://www.geonames.org/export/geonames-search.html">search web service documentation</a>