Extension talk:GoogleSiteSearch

Jump to navigation Jump to search

About this board


/Archive 1


Discuss Extension:GoogleSiteSearch here:

Would GoogleSiteSearch work for a private wiki?

2 (talkcontribs)

My company uses a private wiki (not listed on google). I'd love this exntension because our wiki search is really bad because it is case sensitive, etc. Could I use GoogleSiteSearch our private wiki? Or would you recommend another extension for this purpose?

FreedomFighterSparrow (talkcontribs)

Hi, this would only work for a public wiki, as it relies on Google's indexing. You would be better off installing CirrusSearch.

Reply to "Would GoogleSiteSearch work for a private wiki?"

Is wgGoogleSiteSearchCSEID Required?

Summary by Kghbln

Yes, it is. (talkcontribs)

My wiki is intranet only. Current;y running on my desktop until someone frees up a server for me. Is the CSEID an absolute requirement? I'm going to install anyway but just in case I get stuck I'd like to know. (talkcontribs)

Nevermind! "The ID of the created Google custom search engine. Required." That's crazy.

Summary by Kghbln

Yes, it'll still work. You can still create CSEs through https://cse.google.com/ and use the CSE IDs.

Kkm5848 (talkcontribs)
Fo0bar (talkcontribs)

Yes, it'll still work. You can still create CSEs through https://cse.google.com/ and use the CSE IDs. The GoogleSiteSearch extension just embeds a Google iframe-type setup for that CSE, which is still supported normally.

Fatal Error with latest [SOLVED]

Summary by Jkmartindale

getLang() was deprecated in favor getLanguage(). This is fixed in the latest extension version.

Wmat (talkcontribs)

With the latest master branches of MW and this extension, I'm receiving a Fatal error:

Fatal error: Call to undefined method SpecialSearch::getLang() in extensions/GoogleSiteSearch/GoogleSiteSearch.php on line 81

Did something get deprecated?

Wmat (talkcontribs)

It seems getLang() is deprecated and getLanguage() should be used.

How to make search results open in same window?

Summary by Jkmartindale

Version 3.0 added this as the default. In previous versions this can be accomplished by editing a line in GoogleSiteSearch.content.default.html from customSearchControl.setLinkTarget(google.search.Search.FILTERED_CSE_RESULTSET); to customSearchControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF);.

2601:5:1800:248:B1AA:719B:3289:8F58 (talkcontribs)

Thank you for the extension. I wanted to know if it is possible to have search results open in same winodow/tab when clicked. As of now it opens in a new window/tab instead of just taking user to the page. Is this something that can be implemented?

Wikimanz (talk) 06:27, 29 March 2014 (UTC) (talkcontribs)

I'd be interested in this too.

Anyone have any ideas? (talkcontribs)

OK, I've managed to solve it.

Edit the GoogleSiteSearch.content.default.html

Change the line: customSearchControl.setLinkTarget(google.search.Search.FILTERED_CSE_RESULTSET);

To: customSearchControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF);

Fo0bar (talkcontribs)

The latest release (3.0) changed the CSE API used, and now defaults to same window/tab.

Summary by Jkmartindale

GoogleSiteSearch can work with the Sphinx search engine.

Christharp (talkcontribs)


I currently use the Sphinx Search on my wiki and was wondering if GoogleSiteSearch can work with Sphinx? Love the concept of this seach extension. Thanks

Christharp (talkcontribs)

I'll reply to my self. This extension works great with the Sphinx search. (talkcontribs)

Not sure if this is the right place, but wanted to say thank you for an amazing extension! This has totally transformed my site :)

Problem handing off accents from wiki search form to Google search form

Vitruvian95 (talkcontribs)

Installed your extension, and searching for terms in the Google search form work fine. However, my wiki is in Spanish and if I place a term with accents in the wiki search form (in the toolbar or Special:Search), it runs into trouble. This appears to pass coded accents to Google (i.e. "currículum" instead of "currículum"), and then Google returns no results for the search. Thanks for your help.

This post was posted by Vitruvian95, but signed as Felipe95a.

Jossmart (talkcontribs)
My wiki in Czech language has the same problem. The solution is replacing htmlentities with htmlspecialchars in
$outhtml = str_replace( '_GSS_TERM_ESCAPE_', htmlentities( $term, ENT_QUOTES, $wgGoogleSiteSearchCharset ), $outhtml );
Vitruvian95 (talkcontribs)

Thanks! That worked for the accents. However, the extension still has trouble interpreting the inverted commas in exact searches (e.g. "currículum nacional"). Any suggestions are appreciated.

This post was posted by Vitruvian95, but signed as Felipe95a.

Fo0bar (talkcontribs)

The latest release (3.0) should have i18n/UTF-8 issues sorted out. For an example, see e.g.

Reply to "Problem handing off accents from wiki search form to Google search form"

Display Google Search Results Below MediaWiki Search Results

2 (talkcontribs)


I'm using MediaWiki v1.26, is there any way to have the Google search results display below the MediaWiki search results?

Fo0bar (talkcontribs)

Technically it could be done, but is not feasible because the results would not be reliable because there are times when the SpecialSearchResultsAppend hook does not run, while SpecialSearchResultsPrepend is always guaranteed to run before the MediaWiki results. See Manual:Hooks/SpecialSearchResultsAppend for details.

Reply to "Display Google Search Results Below MediaWiki Search Results"

Make Google Search results appear below Wiki results?

2 (talkcontribs)

Is there a way to make the CSE results section appear after (below) the normal Wiki Results? (Basically put the inserted html at the end of the Search page instead of at the top)

I want exact matches to a Wiki Page Title and wiki Page contents to appear first if there's an exact/good match; however, if we haven't actually documented something on the wiki, I want the "secondary" results to be the CSE search of our separate API page. Make sense?

Cavila (talkcontribs)

Good question! That makes sense. I just had a go at GoogleSiteSearch.php, without any luck though.

Reply to "Make Google Search results appear below Wiki results?"
There are no older topics