Extension talk:GoogleSiteSearch

About this board

Archives

/Archive 1

Discussion

Discuss Extension:GoogleSiteSearch here:


Display Google Search Results Below MediaWiki Search Results

3
50.251.57.77 (talkcontribs)

Hello,

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.

Sophivorus (talkcontribs)

Hi! I just sent a patch-for-review that adds the option to display the Google search results below the MediaWiki search results. I understand that sometimes this may cause the Google search results to not show, but this can always be documented next to the relevant config option and the choice left to the user. Please check it out! PS, if there's no reply, I may request ownership of the repo to merge this and other improvements, cheers!

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

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

4
Summary by Sophivorus

Fixed in version 3.0+

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
GoogleSiteSearch.php:
$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.

How to make search results open in same window?

2
41.254.66.147 (talkcontribs)

How to make search results open in same window?

Sophivorus (talkcontribs)

Would GoogleSiteSearch work for a private wiki?

2
Summary by Kghbln

No, since the search is relying on public search indexing.

97.120.122.216 (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.

Is wgGoogleSiteSearchCSEID Required?

2
Summary by Kghbln

Yes, it is.

64.4.113.174 (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.

64.4.113.174 (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]

2
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?

4
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)

83.100.199.133 (talkcontribs)

I'd be interested in this too.

Anyone have any ideas?

83.100.199.133 (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)

Hi

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.

109.144.204.76 (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 :)