<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "SearchResult"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "SearchResult"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>SearchResult</title>
				<description><![CDATA[ I have just started including geonames in my java program. Something happens with the search result hit list when I try to get different attributes from the hits. 

Let's say I get 100 hits, if I loop over the list I get name, country, latitude and longitude for every hit. If I try to get adminName1 the list suddenly contains only 1 hit. See code below - any of the the get-methods which are commented out affects the number of items in the hit list (btw "stedsnavn" = place name).

I can't find an answer to this anywhere, but I suppose it's because I'm a novise.

The code:
     try {
            ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria();
            searchCriteria.setQ(stedsnavn);
            ToponymSearchResult searchResult = WebService.search(searchCriteria);
            List<Toponym>tp = searchResult.getToponyms();
            System.out.println("Number of hits = " + tp.size());
            int k = 0;
            for (int j = 0; j < tp.size(); j++) {
                Toponym toponym = tp.get(j);
                k++;
                System.out.println("Nr " + k);
                System.out.println("Name       = " + toponym.getName());
                System.out.println("CountryName= " + toponym.getCountryName());
                System.out.println("Latitude   = " + toponym.getLatitude());
                System.out.println("Longitude  = " + toponym.getLongitude());
                /*
                System.out.println("AdminCode1 = " + toponym.getAdminCode1());
                System.out.println("AdminName1 = " + toponym.getAdminName1());
                System.out.println("AdminName2 = " + toponym.getAdminName2());
                System.out.println("Alternate  = " + toponym.getAlternateNames());
                 * */
            }
        } catch  ... etc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1613.page#6685</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1613.page#6685</link>
				<pubDate><![CDATA[Wed, 18 Nov 2009 20:15:01]]> GMT</pubDate>
				<author><![CDATA[ knuthe]]></author>
			</item>
			<item>
				<title>Re:SearchResult</title>
				<description><![CDATA[ You should look at the Exception you get then you understand.

The adminName1 is not included in the default result, you have to set the 'style' to a higher value to have the field filled.

Best

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1613.page#6686</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1613.page#6686</link>
				<pubDate><![CDATA[Wed, 18 Nov 2009 20:20:24]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
			<item>
				<title>Re:SearchResult</title>
				<description><![CDATA[ Thanks a lot. The exception explained a lot and setting the Style to FULL gave me all the infomation I asked for:

searchCriteria.setStyle(Style.FULL);

Knut]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1613.page#6687</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1613.page#6687</link>
				<pubDate><![CDATA[Wed, 18 Nov 2009 21:31:35]]> GMT</pubDate>
				<author><![CDATA[ knuthe]]></author>
			</item>
	</channel>
</rss>