Quasi-Functional Search

November 6, 2015,   |   Tech
Agile League

There are plenty of website features that can sit in a half-broken state for a long time. They don’t toss outright errors or exceptions, but at the same time they don’t really work all that well. Site search is the perfect example here. If you’ve got a CMS or other application where search is a bit of an afterthought, there’s good chance that it’s 99% junk. When was the last time you were looking for something on a website and saw the magnifying glass in the top right and thought, “Hmm, this will be exactly what I need…”?

Search is one of those features where it can be technically functional but still pretty useless. Luckily, there are a few things we can do.

Search Quick Fixes

If you’re guilty of the quasi-functional search, here are a few things you can do in order to go from 99% junk to probably somewhere around 80%. I know it’s not great, but there’s a reason Google is a bazillion dollar company and has 1000s of engineers and geniuses working on this problem. Below is an ordered list, with the best bang-for-the-buck in the earlier steps.

  • Replace LIKE %foo% search with a real search engine! PostgreSQL can do it natively, so you don’t even need an external search server! But, assuming you’ve already done that…
  • Replace PostgreSQL search with a real search engine! If you’re already doing full text searching in Pg and you want to improve it, you’ll probably want the flexibility that a “real” search engine provides. I’ve used Solr in the past and been pleased with it.
  • Check your advanced searching and/or search options. If you offer your users the ability to facet or scope the searches, make sure this actually works. This is the kind of thing that often just quits working and you never know.
  • Play with your field boosting. If you haven’t configured boost values for the different fields of your documents, try giving the title or subject of a document a boost and see if that improves the relevancy ranking.
  • Play with your search result pages. Look closely at what you’re showing. Are you including a highlighted snippet? Is that snippet useful? Are you showing enough context about the document to help a user decide if they’ve found the right result?
  • Play with spell checking and auto-suggesting. Solr supports all kinds of fancy suggestion abilities. I’ve never used them, so I can’t speak to their usefulness, which is why they’re at the bottom of the bang-for-buck list.

Quasi-functional to Quasi-fixed

There you have it. A handful of checks and tweaks you can make to your intra-site search. By far the most important one would be switching LIKE to full text, but it’s still worth playing with some of the others every now and then just to make sure the search feature stays somewhere better than 99% junk.

Okay, now that you’ve done that, it’s on to improving the other quasi-functional areas of your site. Might I suggest that signup form that gives cryptic errors like, “Either username or password or something else went wrong. Good luck figuring it out.” 😉