Site search large result set

2 views
Skip to first unread message

David Sims

unread,
Jan 28, 2008, 7:19:49 PM1/28/08
to Google AJAX API
I am sorry to have to post but after 2 days I am defeated

If you type SEAC here: http://www.theseacpages.co.uk/Search.aspx

there are many results but only 1 displays - I want them all to
display

I have read the docs and the newsgroup

TIA

D

jgeerdes [AJAX APIs "Guru"]

unread,
Jan 28, 2008, 11:08:08 PM1/28/08
to Google AJAX API
Search the documentation for EXPAND_MODE_OPEN. That should give you 4
results at a time. If you want still more (up to 8 at a time), search
again for LARGE_RESULTSET. Please keep in mind, though, that you will
only ever get a maximum of 32 results from the API.

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

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

David Sims

unread,
Jan 29, 2008, 2:49:17 AM1/29/08
to Google AJAX API
Jeremy - thanks for the reply

I have already followed and read every doc and suggestion in this
group and am completely stuck

D

On Jan 29, 4:08 am, "jgeerdes [AJAX APIs \"Guru\"]"
> jgeer...@mchsi.com

jgeerdes [AJAX APIs "Guru"]

unread,
Jan 29, 2008, 7:12:12 AM1/29/08
to Google AJAX API
What I'm seeing in your application is that you are creating one
searcher, which is restricted to your site, and then adding it to your
control twice. Here's a rundown of what your script is doing, then:

1. Initializes the search control (Good).
2. Initializes the searcher options var options (Good).
3. Creates the searcher var siteSearch, initializes various settings
on it, and restricts it to your site (Good).
4. Adds the searcher to your control WITHOUT options (If you want the
searcher to show more than one result off the bat, this is not good.).
5. Sets the options expand mode to open (Good).
6. Re-adds the searcher to your control WITH options (This effectively
steals the searcher from the first section of your control because it
will reset the search complete callback to drop results into the
second section, despite the fact that the first section's elements
will all remain. BUT, when I search for "car", there are four results
returned and posted into this section. So this is Good.).

You will notice a couple of things: there is no point where you ask
for a large resultset because, even though the call is in the code,
it's commented out by the preceding //. So you will only get a small
resultset of 4 results at a time. This is an important thing to note
because, even with the large resultset, you will only ever receive up
to 8 results at a time, but you can click through 4 pages results (for
a total of 16 results with the small set or 32 with the large). If
you want more results than that, you're going to have to roll your own
CSE (which the search control will direct the "More Results" link to)
or build your own search API.

All of that to say, the best you're going to do is to remove the first
searchControl.addSearcher(siteSearch); completely, and uncomment the
line reading searchControl.setResultSetSize(...);

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

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

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

David Sims

unread,
Jan 30, 2008, 6:38:39 AM1/30/08
to Google AJAX API
Jeremy thanks very much for the pointers

In between my last post and yours I found some further info and had
been experimenting ! LOL

I saw the 2 search controls but then could not sort it out

The Google docs are not that great

Thanks again

David

On Jan 29, 12:12 pm, "jgeerdes [AJAX APIs \"Guru\"]"
> jgeer...@mchsi.com
Reply all
Reply to author
Forward
0 new messages