Search

@ahwayakchih I forgot to mention that this Ext. is fantastic and really useful, even limit to 8 pages of results. I’m migrating a site to Symphony that already has a gcse, so this is just what I needed. Anyway, regarding the problem:

On my GCSE admin page:

Search for: {$q:$url-q}

Unique identifier: 009685165981579916061:_extys8zzai

Show page: {$p:$url-p}

The issue seems to occur for all queries going over 8 pages, e.g. ‘green’

my-search-page/?q=green&p=8 Results in the GCSE DS full of results, as it should be, but

my-search-page/?q=green&p=9 Results in a ‘no data found’ with the 400 error.

IPOTS, You mean title and content of each result entry?

ashooner Looks like You discovered another limit set by Google :(. I just tried data You provided to call Google directly:

  • ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&start=56&hl=en&lr=lang_en&cx=009685165981579916061:_extys8zzai&q=green works (start is 7*8, where 7 is page number and 8 is page size. pages start from 0, that is why 8th page changes to 7 in code :),
  • ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&start=64&hl=en&lr=lang_en&cx=009685165981579916061:_extys8zzai&q=green does not work (“out of range start”).

I just pushed tiny change to GitHub, which makes use of message provided by Google (instead of simply writing “No data found.”). That should help debugging strange behaviour next time someone finds it :).

Thank You guys for reporting stuff :).

I figured as much, since it was consistent. Thanks for the update! Like I say, still very useful with that limit (don’t anticipate many users going past page 8 anyway.

Thanks.

don’t anticipate many users going past page 8 anyway

Yeah, not only it requires a lot of patience but also there’s not much sense in doing so, because there’s little chance to get good results there (at least i never, or almost never, find them this way - IMHO it’s better to just try different set of keywords :).

I’ve uncovered a nasty issue with thix extension; It appears that GCSE API will return html entities (eg: ·) that throw an error in Symphony.

@ashooner: this is something we need to address. As for the forum, the event should be checking for XML validity so I’m surprised this fell through the cracks.

ashooner, thanks for info. Do You think it would be better if extension removed entities from data (translating them to UTF-8 characters)? That should make things safer, but i’m not sure people would want that because of additional time and CPU usage.

The alternative is to declare the entities in the XML, thereby making them valid and safe.

Allen, is it possible to declare entities inside child nodes? I mean, can i declare entities in XML returned by data source?

Thank you so much for this extension. I just added site search to my website in fifteen minutes, from installing your extension to styling a pages results page. Amazing :-)

ahwayakchih, you or anyone has a demo up of this on a life site, would like to check it out, without neding to install and wait for spidering

Not that I can let you log in to ;-) Without seeing the XML response in the ?debug there’s not to see other than Google-style results in a page.

You let it apear inside the formfield, let it expand, or redirect to a new page; how do you do things layout and UI wise?

Here’s an example from the Yahoo! BOSS extension (the Yahoo and Google extensions are almost identical).

http://battlefront.co.uk/search/?q=knife+crime

nickdunn thanks :)!

newnomad i don’t have demo, but http://myhaiku.pl/szukaj/ (Polish site) uses it on Symphony 1.7. Search for something related to operating system and hardware, like “SATA” and You should see some results.

Layout/UI can be whatever You want. Extension simply gives You data just like any other data source (different tag names, but there is example page which doesn’t require Google to index Your site :), so You can present it in any way You want. You can use AJAX if You want, or not. You can show text field and/or use direct links to result pages.

@ahwayakchih: I implemented the extension and noticed that still entities like · returning from Google will breakt XSLT transformation. As a quick fix I changed line 159 of data.gcse.php to be:

$entry->appendChild(new XMLElement('content', html_entity_decode($result->content, ENT_QUOTES, 'UTF-8')));

What do you think about this?

I got a question about GSCE and Ads:

If I setup a custom search engine, I have to select a free, ad-based version or a payed, ad-free version. The terms of use of Google AJAX Search (which is used in this extension) do not mention ads. Does anybody know more about this? Will search results fetched with this extension be ad-free?! If yes, does this interfere with the terms of use of Google Custom Search Engine?

As far as I know the results are ad-free. I’ve used it several times and the results returned seem to be the natural results from Google’s index (here’s an example).

I am getting errors when GCSE is returning entities… What am I missing?

Additionally: It is kind of hard to get the markup from <content> when there is no surrounding element like a <p>.

michael-e: Although I’ve posted to this thread before (and should have seen your code) I came up with the same solution. :-)

No answer from ahwayakchih yet? :-/

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details