I’ve added a search form to Wap Review Mobile. I was starting to have trouble finding my older posts and I figured my readers might appreciate being able to search the mobile blog too. On the PC edition of Wap Review I just use Google’s Site Search and I would have liked to do the same for mobile. Unfortunately, Google’s TOS, at least as I interpret it, doesn’t let you create your own search form which calls the mobile search engines at google.com/xhtml or google.com/wml.
I tried a half dozen or so PHP site search modules and didn’t like any of them until I happened on Sphider by Ando Saabas, which is a truly beautiful peace of code. It’s Open Source, clearly documented and has a slick admin panel that lets you configure it extensively. Installation was straight-forward and it worked out of the box the first time. Of course Sphider isn’t mobile specific, the search form and results pages need to be adapted for a mobile site. Sphider cleanly separates logic from presentation with all the html and css isolated in a template directory. You can have as many templates as you want each implementing different features and layout and you can switch templates from the Sphider console. I created a mobile template with accesskeys and some rudimentary browser sniffing to serve the search form and results as wml, cHtml or xhtml-mp depending on browser capabilities. I’m still working on the wml support for yeswap.com but when I finish I’ll make the mobile template available for download.
Sphider uses search syntax almost identical to Google so using it should be self explanatory. And, Or, +, – and stemming are all supported and Sphider will even suggest alternate spellings just like Google.
Let me know if you find the search useful or encounter a bug and if you are looking for a site search engine, check out Sphider.
Update: Sphider 1.3.6 and earlier have been found to have multiple security vulnerabilities. I no longer use it on my sites and do not recommend it.