That little search field and button in WordPress has not changed in function one bit since i started with WordPress. Oh sure, you can pop words in there, and get list of results. That works. But it is really limiting, especially when you have a few years heaped up of posts.
Let me be more specific. If I want to find something I wrote about Jim Groom and car toys, if I type in the search field
Jim Groom Car Toys
My results will include posts that mention Jim Morrison, ones about Jim beam, Ones about not wanting to be a bride of a groom, ones about Dean Groom, onces about Car Shows, ones about Toys are us, and maybe after I page through 5 pages of results, I might find the one I want.
You see, the WordPress search is all OR. It matches “Jim” OR “Groom” OR “Car” OR “Toys”. And… the results are not in relevance order, I get reverse chronology, which does not help me at all in finding.
That is like Search 0.5, back in te days of AltaVista.
If I was searching in Google, I’d be smarter, and do a search like:
“Jim Groom” Car +Toys
So I get an exact match on the name, and force the results to have Toys in it (I may be less sure it had “Car” or “Truck”.
I did some quick poking at the WordPress Plugins and did not find too many search enhancements– I thought there would be a good set of them. I found ones that expand the search to include pages, tags, etc.
But then I found the Google Custom Search plugin. Now GSE is one of the lesser used, less understood powerful tools in the Google jet pack. The premise is simple- you can create your own search tools, that rather than search all 29 gazillion web pages that Google crawls, you can provide a list of web sites that it searches.
So you can create your own search, to use the Google method to search, say only web sites about literature, or only ones about christmas toys…. okay those are made up. I created one to search among a set of open education sites and one for NMC’s Horizon Project to search among a collection of emerging tech sites… a while ago Leigh Blackall set one up to search Free Media sites — in this case he invited me to join so I can add sites to the list.
Am I on drugs or is this not just a fantastic tool for any teacher? You select the sites that students search from, so they are not trolling among the entire web, or getting lost in cat videos in the results. Or even better, you have your students research and add to the list of the sites included in the tool.
Okay, I digress because I have come across very few teachers using GSE.
But this is where the WordPress plugin is clever. What you do is set up a Google CSE to search just one site, your own blog– I pointed mine at http://cogdogblog.com/
With the Google Custom Search plugin, you copy the code GSE provides into a settings field. You use the GSE approach of embedding the results in your own web site.
Now I got tripped up one something in setting it up- the idea is the the plugin routes the basic WordPress search that looks like http://cogdogblog.com/index.php?s=dogs+rule+cats+drool and sends it to a GSE, and the results that appear on a page at http://cogdogblog.com/search — but no mater what I tried that did not happen.
So I looked at the source code of the GSE search form, and went into my template. Most modern templates have the search form HTML code in a file called searchform.php. I made a copy of that as backup, and replaced the form elements with what the GSE provides– so the search box on my site sends the query to Google, and it shoots the results on my page.
This way, I can use all of the modifiers I do in a Google search, and get relevance ranked results. Another nice surprise is that it is returning things that sit outside my blog, like my presentations under cogdogblog/stuff. Woah Neoh- this is now a site search tool, not just a blog search.
Yes, I have to do some CSS work on the output. And I am not crazy about the ads (I thought of lying on the GSE form about being a registered non-profit or university). And for some reasons the search words dont come through on the form on the results page– but those are just minor things that need a fix.
I’m going to play with it a bit more, but I like it. I am sure someone will comment how I am selling my soul to the Borg by letting Google crawl all over me.
But c’mon WordPress developers, how about creating a search tool that is not start of the art 1996?
UPDATE: Thanks to Joss Winn– I completely overlooked, missed, the WP Search API plugin, which offers either advanced wordpress search or intergation with GSE. I got that one going, and it is more elegant and cleaner, though I am having some challenges on controlling the width of the output. But it seems a better.
UPDATE UPDATE: Tried switching WP Search API plugin to use the MySQL search plugin, but it produced fatal errors. The Google search was less than ideal with some more trying. I alos tried the Relavassi plugin recommended by D’Arcy, but it crapped out each time trying to index (gave up after 5 rounds). I’m stuck back now to basic old WP built in search.
The post "There’s Gotta Be a Better Way To Search a WordPress Blog" was originally squeezed out of the bottom of an old rusted tube of toothpaste at CogDogBlog (http://cogdogblog.com/2010/03/search-wp-blog/) on March 10, 2010.