GoogleSearchList - The Google search result set size

18 views
Skip to first unread message

Marcio Brambilla

unread,
Oct 17, 2012, 7:53:07 PM10/17/12
to mashups...@googlegroups.com
Anyone know how to return more than 8 results on google?

Hazem Saleh

unread,
Oct 18, 2012, 9:24:53 AM10/18/12
to mashups...@googlegroups.com
Unfortunately, Google Mashup APIs provide displaying 8 ("large") or 4 ("small") results per the single API call.

In Mashups4JSF, you can display 8 rows by setting the GoogleSearchServiceParameters.RSZ to "large":
    public String getWebSearchResultList() {
        List<ServiceParameter> searchParameters = new ArrayList<ServiceParameter>();
      
        System.out.println("search query is: " + searchQuery);
      
        searchParameters.add(new ServiceParameter(GoogleSearchServiceParameters.QUERY, searchQuery));
        searchParameters.add(new ServiceParameter(GoogleSearchServiceParameters.RSZ, "large"));       
      
        try {
            results = GoogleServicesFactory.getGoogleSearchService().getWebSearchResultList(searchParameters);
        } catch (Exception e) {
            e.printStackTrace();
        }
      
        return null;

    }



On Thu, Oct 18, 2012 at 1:53 AM, Marcio Brambilla <brambill...@gmail.com> wrote:
Anyone know how to return more than 8 results on google?



--
Hazem Ahmed Saleh Ahmed

Author of (The Definitive Guide to Apache MyFaces and Facelets):
http://www.amazon.com/-/e/B002M052KY

DeveloperWorks Contributing Author
https://www.ibm.com/developerworks/mydeveloperworks/blogs/hazem/entry/ibm_developerworks_contributing_author?lang=en_us

An Apache committer, IBMer, and a technical speaker

Twitter: http://www.twitter.com/hazems

Reply all
Reply to author
Forward
0 new messages