[How To] Add Ajax based search to your wiki

Use this forum to ask questions about how to do things with my MediaWiki Extensions.
Post Reply
User avatar
node
Rank 4
Rank 4
Posts: 21
Joined: July 19th, 2008, 2:51 am

[How To] Add Ajax based search to your wiki

Post by node »

Well thought such tutorial would be usefull. I found a real nice extension that allows users to integrate ajax based search.. woah sounds jargon in simple words... it suggests words as you type..okay so how do we install it?

1. Dowload this extension http://www.mediawiki.org/wiki/Extension:Search_Suggest

Here you would find code for file SearchSuggest.php, SearchSuggest.js, SearchSuggest.css

2.Edit the file SearchSuggest.js to adapt to skin

function SearchCall(){
var newdiv = document.getElementById("searchsuggest");
if (!newdiv) {
var newdiv = document.createElement("div");
newdiv.id = "searchsuggest";
var searchdiv = document.getElementById("gumax-searchBody");
searchdiv.appendChild(newdiv);
}
Now after you have these files put them in a folder called SearchSuggest...

3.add line to localsettings.php $wgUseAjax = true;
4.add line require_once("$IP/extensions/SearchSuggest/SearchSuggest.php"); to localsettings.php

Thats it ur done! now when u do type a letter the search box will suggest words! Paul guess this go as a sticky in some due course of time!

Regards,
Node
:ugeek:
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: [How To] Add Ajax based search to your wiki

Post by Paul »

Well done :D... I didn't know this
User avatar
node
Rank 4
Rank 4
Posts: 21
Joined: July 19th, 2008, 2:51 am

Re: [How To] Add Ajax based search to your wiki

Post by node »

no problem Paul i happy to help you out :D
Btw i am rite now working on the css to make it look more appealing shall post more soon!
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: [How To] Add Ajax based search to your wiki

Post by Paul »

Great! Thanks for great work.
Post Reply