Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3242110
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:16:36+00:00 2026-05-17T18:16:36+00:00

I have found several extensions for MediaWiki which allow you put a Google search

  • 0

I have found several extensions for MediaWiki which allow you put a Google search box for searching the web on your MediaWiki site. However, none of them seem to have an option to enable suggest, which populates a drop down menu of possible search terms based on what the user has typed in so far. How can I do this?

I posted this to Stackoverflow, because the solution will most likely require programming.

FYI, the existing extensions I found are:
– http://www.mediawiki.org/wiki/Extension:GoogleSiteSearch
– http://www.mediawiki.org/wiki/Extension:Google

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:16:37+00:00Added an answer on May 17, 2026 at 6:16 pm

    First you need to add a new file to your mediawiki installation. Just call it googleSuggest.php. You need this file because of cross-domain issues with browser web security (you can thank the browser developers)

    Add the following code to it:

    <?php
    $q = strtolower($_GET["q"]);
    if (!$q) return;
    
    $url="http://suggestqueries.google.com/complete/search?qu=".$q;
    $text = file_get_contents($url); //Get content from Google suggest
    $text=str_replace("window.google.ac.h([\"$q\",[[","",$text); //Remove unwanted portion
    $arr_items=explode("],[",$text); //Split and put it in arrary
    foreach($arr_items as $items)
    {            $arr_item=explode(",",$items);
                $key=$arr_item[0]; //Get the keyword, the arrary will have other details such as no.of resutls also.
                $key=trim($key,"\""); //Use to remove quotes
            if (strpos(strtolower($key), $q) !== false) {
                echo "$key\n";
            }
    
    }
    ?>
    

    Then you will need to download jquery from jQuery.com
    Then you will need to get this plugin:http://docs.jquery.com/UI/Autocomplete

    Then you will need to edit the head section. Add the following lines.

    <script type="text/javascript" src="PATHTOJQUERY.JS"></script>
    <script type='text/javascript' src='PATHTOjquery.autocomplete.js'></script>
    <link rel="stylesheet" type="text/css" href="PATHTOjquery.autocomplete.css" />
    
    <script type="text/javascript">
    var keywords=['qualitypoint','qpt','quality','one','two'];
    $().ready(function() {
    
    
        $("#q").autocomplete("googleSuggest.php", {
            width: 260,
            selectFirst: false
        });
    
        $("#q").result(function(event, data, formatted) {
            if (data)
                $(this).parent().next().find("input").val(data[1]);
        });
    
    
    });</script>
    

    Then, where you want the web search:

        <form method="get" action="http://google.com/search" autocomplete="off" >
            <p>
    
                <input type="text" id="q" />
    <input type="submit" value="Google Search" />
    
            </p>
        </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found several other questions here on S.O. (and the web in general)
I have found several questions asking about template typedefs in C++0x, which are resolved
I have found several posts on SO talking about deploying web projects with git.
I have found several guides on how to get a 3D animation to flip
I have found several examples using datamapper and was able to get them to
I've investigated several C# DLL's and have not found any that work especially well.
I've looked through several posts but I haven't quite found any answers that have
I have found several post with similar problems, but none targeting my exact problem:
I have found several answers to this problem, however it is not what i
I need to create a new user in Active Directory. I have found several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.