[How To] Add Ajax based search to your wiki
Posted: August 18th, 2008, 2:55 am
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
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