Increase web search results in java

1 view
Skip to first unread message

Andy6

unread,
Jul 2, 2008, 7:29:19 PM7/2/08
to Google AJAX API
Hi,

I'm new to AJAX API. Can somebody please show me how to increase the
number of search result in Java web application? My URL is
URL url = new URL("http://ajax.googleapis.com/ajax/services/search/web?
v=1.0&num=24&hl=en&start=10&sa=N&q=" + encodedSearch);

and I always get
"pages":[
{"start":"0","label":1},
{"start":"4","label":2},
{"start":"8","label":3},
{"start":"12","label":4}
],
"currentPageIndex":0,

Thank you very much!

Andrew

Ben Lisbakken

unread,
Jul 2, 2008, 7:36:20 PM7/2/08
to Google-AJAX...@googlegroups.com
Try putting the start parameter to 0, 4, 8, or 12 (vs. 10).

-Ben

Andy6

unread,
Jul 3, 2008, 11:41:27 AM7/3/08
to Google AJAX API

Hi Ben,

I have tried the start parameter with 0, 4, 8, 12 and I still got 4
results.
What else do I need to do or fix to increase the number of results?
Thanks.

Andrew

On Jul 2, 4:36 pm, Ben Lisbakken <lisba...@google.com> wrote:
> Try putting the start parameter to 0, 4, 8, or 12 (vs. 10).
>
> -Ben
>
>
>
> On Wed, Jul 2, 2008 at 4:29 PM, Andy6 <andrewt...@yahoo.com> wrote:
>
> > Hi,
>
> > I'm new to AJAX API. Can somebody please show me how to increase the
> > number of search result in Java web application? My URL is
> > URL url = new URL("http://ajax.googleapis.com/ajax/services/search/web?
> > v=1.0&num=24&hl=en&start=10&sa=N&q=<http://ajax.googleapis.com/ajax/services/search/web?v=1.0&num=24&hl=e...>"
> > + encodedSearch);
>
> > and I always get
> > "pages":[
> >        {"start":"0","label":1},
> >        {"start":"4","label":2},
> >        {"start":"8","label":3},
> >        {"start":"12","label":4}
> >        ],
> > "currentPageIndex":0,
>
> > Thank you very much!
>
> > Andrew- Hide quoted text -
>
> - Show quoted text -

Ben Lisbakken

unread,
Jul 3, 2008, 2:11:02 PM7/3/08
to Google-AJAX...@googlegroups.com
Andy --

Try setting rsz=large in the CGI arguments.  That will give you 8 results per query.  Then, by using the start CGI arg, you can make 4 requests for a total of up to 32 results.

-Ben

Andy6

unread,
Jul 3, 2008, 2:30:56 PM7/3/08
to Google AJAX API

Ben,
Thank you very much!

Andrew

> > > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages