Page 1 of 1

[How To] Add Ajax based search to your wiki

Posted: August 18th, 2008, 2:55 am
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:

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

Posted: August 20th, 2008, 11:09 pm
by Paul
Well done :D... I didn't know this

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

Posted: August 21st, 2008, 1:36 am
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!

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

Posted: August 21st, 2008, 9:29 pm
by Paul
Great! Thanks for great work.