how to get more then 8 results, or get result starting from some number

17 views
Skip to first unread message

obo jo

unread,
Aug 13, 2009, 6:18:15 AM8/13/09
to Google AJAX APIs
i have trouble getting more then 8 results with the gWebSearch.

even tho i placed this code:

gWebSearch.setResultSetSize(google.search.Search.LARGE_RESULTSET);

when i try to loop over the results i only get 8

for (var i = 0; i < gWebSearch.results.length; i++)

so what i wanna do is to find a way to get like 50 results, or if it
cant be done, do get results starting from a variable, so i can get it
all 8 by 8.

thank you very much for helping me.

Jeremy Geerdes

unread,
Aug 13, 2009, 7:22:57 AM8/13/09
to Google-AJAX...@googlegroups.com
The API will only return results in sets of 8, but you can get up to 8
sets of 8 for a total of up to 64 results. Check out my blog entry
about how you can get all of these results sequentially at the link
below. Make sure to read the comments, too, as there's a critical bug
fix in there.

http://jgeerdes.blogspot.com/2008/12/how-to-get-all-results-available-from.html

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
http://jgeerdes.blogspot.com
http://jgeerdes.wordpress.com
jgee...@mchsi.com

Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com
!

Wouter

unread,
Aug 13, 2009, 7:54:53 AM8/13/09
to Google AJAX APIs
How can I do this in a Non-Javascript Environment (java)?

On 13 aug, 13:22, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> The API will only return results in sets of 8, but you can get up to 8  
> sets of 8 for a total of up to 64 results. Check out my blog entry  
> about how you can get all of these results sequentially at the link  
> below. Make sure to read the comments, too, as there's a critical bug  
> fix in there.
>
> http://jgeerdes.blogspot.com/2008/12/how-to-get-all-results-available...
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.comhttp://jgeerdes.blogspot.comhttp://jgeerdes.wordpress.com
> jgeer...@mchsi.com
>
> Unless otherwise noted, any price quotes contained within this  
> communication are given in US dollars.
>
> If you're in the Des Moines, IA, area, check out Debra Heights  
> Wesleyan Church!
>
> And check out my blog, Adventures in Web Development, athttp://jgeerdes.blogspot.com

Jeremy Geerdes

unread,
Aug 13, 2009, 8:03:08 AM8/13/09
to Google-AJAX...@googlegroups.com
To do this in a Non-JS environment, you'll need the same concepts
outlined in my blog post. The difference would be that, instead of
using JS API calls (e.g., gotoPage), you would need to make the next
successive call to the RESTful API.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com
!

obo jo

unread,
Aug 13, 2009, 9:32:19 AM8/13/09
to Google AJAX APIs
thank you very much!
i only have one problem now, i cant get each result's url and title as
raw data like that:

result.url,result.title.

i can only get the entire result from

result.html.cloneNode(1)

how can i get the url specificly?

On Aug 13, 2:22 pm, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> The API will only return results in sets of 8, but you can get up to 8  
> sets of 8 for a total of up to 64 results. Check out my blog entry  
> about how you can get all of these results sequentially at the link  
> below. Make sure to read the comments, too, as there's a critical bug  
> fix in there.
>
> http://jgeerdes.blogspot.com/2008/12/how-to-get-all-results-available...
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.comhttp://jgeerdes.blogspot.comhttp://jgeerdes.wordpress.com
> jgeer...@mchsi.com
>
> Unless otherwise noted, any price quotes contained within this  
> communication are given in US dollars.
>
> If you're in the Des Moines, IA, area, check out Debra Heights  
> Wesleyan Church!
>
> And check out my blog, Adventures in Web Development, athttp://jgeerdes.blogspot.com
>   !

Jeremy Geerdes

unread,
Aug 13, 2009, 9:36:29 AM8/13/09
to Google-AJAX...@googlegroups.com
In that same place where you see result.html.cloneNode(1), you can
access the url and title via result.unescapedUrl and
result.titleNoFormatting.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com
!

obo jo

unread,
Aug 13, 2009, 9:46:41 AM8/13/09
to Google AJAX APIs
thank you very much!

On Aug 13, 4:36 pm, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> In that same place where you see result.html.cloneNode(1), you can  
> access the url and title via result.unescapedUrl and  
> result.titleNoFormatting.
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>

obo jo

unread,
Aug 13, 2009, 10:14:52 AM8/13/09
to Google AJAX APIs
i only have one more question and iam good, how can set the search
county to by something like israel instead of the .com witch is the
usa.



On Aug 13, 4:46 pm, obo jo <links...@gmail.com> wrote:
> thank you very much!
>
> On Aug 13, 4:36 pm, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
>
> > In that same place where you see result.html.cloneNode(1), you can  
> > access the url and title via result.unescapedUrl and  
> > result.titleNoFormatting.
>
> > Jeremy R. Geerdes
> > Effective website design & development
> > Des Moines, IA
>
> > For more information or a project quote:http://jgeerdes.home.mchsi.comhttp://jgeerdes.blogspot.comhttp://jgee...
> > jgeer...@mchsi.com
>
> > Unless otherwise noted, any price quotes contained within this  
> > communication are given in US dollars.
>
> > If you're in the Des Moines, IA, area, check out Debra Heights  
> > Wesleyan Church!
>
> > And check out my blog, Adventures in Web Development, athttp://jgeerdes.blogspot.com
> >   !
>
> > On Aug 13, 2009, at 8:32 AM, bo jo wrote:
>
> > > thank you very much!
> > > i only have one problem now, i cant get each result's url and title as
> > > raw data like that:
>
> > > result.url,result.title.
>
> > > i can only get the entire result from
>
> > > result.html.cloneNode(1)
>
> > > how can i get the url specifically?

Jeremy Geerdes

unread,
Aug 13, 2009, 10:22:24 AM8/13/09
to Google-AJAX...@googlegroups.com
If I'm understanding you correctly, you want to be able to search a
localized version of Google (e.g., google.is) rather than google.com .
Unfortunately, that's not exactly possible at this time. What you
could do instead is use the searcher's setRestriction method with the
extended argument lr to set a language restriction.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com
!

obo jo

unread,
Aug 13, 2009, 11:34:27 AM8/13/09
to Google AJAX APIs
OMG no!
the most important part is that it gets the result from google.co.il
data centers, damm.

any ideas what can i do now?

maybe a different api? something from php, a trick perhapse?



On Aug 13, 5:22 pm, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> If I'm understanding you correctly, you want to be able to search a  
> localized version of Google (e.g., google.is) rather than google.com .  
> Unfortunately, that's not exactly possible at this time. What you  
> could do instead is use the searcher's setRestriction method with the  
> extended argument lr to set a language restriction.
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.comhttp://jgeerdes.blogspot.comhttp://jgeerdes.wordpress.com
> jgeer...@mchsi.com
>
> Unless otherwise noted, any price quotes contained within this  
> communication are given in US dollars.
>
> If you're in the Des Moines, IA, area, check out Debra Heights  
> Wesleyan Church!
>
> And check out my blog, Adventures in Web Development, athttp://jgeerdes.blogspot.com
>   !
>

Jeremy Geerdes

unread,
Aug 13, 2009, 12:10:04 PM8/13/09
to Google-AJAX...@googlegroups.com
Unfortunately, there's no other API. The best we can really do is
suggest that you star the issue in the Issue Tracker:

http://code.google.com/p/google-ajax-apis/issues/detail?id=78



Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com
!

Marek

unread,
Sep 8, 2009, 2:16:06 AM9/8/09
to Google AJAX APIs
Jeremy,

first of all - thanks for a great post. It helped me a lot so far.

I've got 1 question:

Also, I'm very new to AJAX API and when I went through tutorials and
Developer's Guide they suggest using SearchControl that wraps multiple
(or just one) Searches, but better yet, it allows the user to specify
the search query with a nice ready GUI. Unfortunately I wasn't able to
modify your code to work with SearchControl - any hints on that would
be greatly appreciated.
So far, I added a webSearch to a SearchController and I switched this
function: setSearchCompleteCallback to be called on the Contoller
instead of the search itself. Unfortunately it produces an error
somewhere else in other JS code parts...
My goal is to let the user specify the query.

Again, thanks for the great work you do. I hope with a little more
help I'll be able to fix my code to work as I intended.

Regards,
Marek


On Aug 13, 8:36 am, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> In that same place where you see result.html.cloneNode(1), you can  
> access the url and title via result.unescapedUrl and  
> result.titleNoFormatting.
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.comhttp://jgeerdes.blogspot.comhttp://jgeerdes.wordpress.com
> jgeer...@mchsi.com
>
> Unless otherwise noted, any price quotes contained within this  
> communication are given in US dollars.
>
> If you're in the Des Moines, IA, area, check out Debra Heights  
> Wesleyan Church!
>
> And check out my blog, Adventures in Web Development, athttp://jgeerdes.blogspot.com
>   !
>
> On Aug 13, 2009, at 8:32 AM, obo jo wrote:
>
>
>
> > thank you very much!
> > i only have one problem now, i cant get each result's url and title as
> > raw data like that:
>
> > result.url,result.title.
>
> > i can only get the entire result from
>
> > result.html.cloneNode(1)
>
> > how can i get the url specificly?
>
> > On Aug 13, 2:22 pm, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> >> The API will only returnresultsin sets of 8, but you can get up  
> >> to 8
> >> sets of 8 for a total of up to64results. Check out my blog entry
> >> about how you can get all of theseresultssequentially at the link
> >> below. Make sure to read the comments, too, as there's a critical bug
> >> fix in there.
>
> >>http://jgeerdes.blogspot.com/2008/12/how-to-get-all-results-
> >> available...
>
> >> Jeremy R. Geerdes
> >> Effective website design & development
> >> Des Moines, IA
>
> >> For more information or a project quote:http://jgeerdes.home.mchsi.comhttp
> >> ://jgeerdes.blogspot.comhttp://jgeerdes.wordpress.com
> >> jgeer...@mchsi.com
>
> >> Unless otherwise noted, any price quotes contained within this
> >> communication are given in US dollars.
>
> >> If you're in the Des Moines, IA, area, check out Debra Heights
> >> Wesleyan Church!
>
> >> And check out my blog, Adventures in Web Development, athttp://jgeerdes.blogspot.com
> >>   !
>
> >> On Aug 13, 2009, at 5:18 AM, bo jo wrote:
>
> >>> i have trouble getting more then 8resultswith the gWebSearch.
>
> >>> even tho i placed this code:
>
> >>> gWebSearch.setResultSetSize(google.search.Search.LARGE_RESULTSET);
>
> >>> when i try to loop over theresultsi only get 8
>
> >>> for (var i = 0; i < gWebSearch.results.length; i++)
>
> >>> so what i wanna do is to find a way to get like 50results, or if it
> >>> cant be done, do getresultsstarting from a variable, so i can  

Jeremy Geerdes

unread,
Sep 8, 2009, 7:04:17 AM9/8/09
to google-ajax...@googlegroups.com
Unfortunately, it will be very, very difficult to adapt the code from
my blog to work with the google.search.SearchControl because the
SearchControl is highly integrated and dependent on the minified API
code. Fortunately, it's not all that difficult to integrate a more
interactive UI with my code. Maybe I'll work on that a little later
today.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com
!


Vision Jinx

unread,
Sep 8, 2009, 8:40:16 AM9/8/09
to Google AJAX APIs
Hi,

You can also check the demos I made here and see if that helps also

http://groups.google.com/group/google-ajax-search-api/browse_thread/thread/14564d2ad0d00b56

More specific to your query, this demo

http://savedbythegoog.appspot.com/?id=ag5zYXZlZGJ5dGhlZ29vZ3ISCxIJU2F2ZWRDb2RlGLzyvgEM

Hope that helps :)

Cheers!
Vision Jinx

Marek

unread,
Sep 8, 2009, 12:21:23 PM9/8/09
to Google AJAX APIs
Thank you Vision! That's exactly what I tried to do, I managed to play
around with you example and adjust it to my needs.
Have a good one!

Marek

On Sep 8, 7:40 am, Vision Jinx <vjn...@gmail.com> wrote:
> Hi,
>
> You can also check the demos I made here and see if that helps also
>
> http://groups.google.com/group/google-ajax-search-api/browse_thread/t...
>
> More specific to your query, this demo
>
> http://savedbythegoog.appspot.com/?id=ag5zYXZlZGJ5dGhlZ29vZ3ISCxIJU2F...
Reply all
Reply to author
Forward
0 new messages