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 some libraries or web services in PHP that does the job.
I have found an interesting issue in windows which allows me to cause the
I have found several links to methods of making extension methods work in .NET2.0
I have found several topics with this title, but none of their solutions worked
I'm developing a dynamic website using jQuery and I have found several jQuery plugins
Inside ActionController class (rails/actionpack/lib/action_controller.lib) I found several weird code. I don't really have a
I have written an ASP.NET web application (not site) in Delphi Prism. Everything works
I have found several similar answers but I can't quite get why this is
I'm in the middle of QA'ing a bunch of code and have found several
I am trying to use ProGuard with Android. I have found several ProGuard scrips

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.