Part Three: The details · Screens

70 Search That Forgives

Exact matching is simple and predictable. People make typos, use plurals, and use words the makers did not.

Search is where people go when they have given up on the menus. They type what is in their head and expect the product to meet them there.

What is in their head is rarely what is in the database. In an online shop they type "runing shoes" on a phone keyboard. They type "trainers" when the catalog says "sneakers," or "tshirt" when it says "T-shirt." In a company tool they type "holiday" when the system calls it "annual leave."

Exact search answers all of these the same way: "No results." The person reads that as a fact. The shop does not sell it, or the record is gone. They leave, or create a duplicate, or email a colleague. The product was only being literal.

Makers like exact matching because it never surprises anyone and never returns junk. Those are real virtues in a query language. Most people are asking a question, the way they would ask a shop assistant, who would never answer "no results" to "runing shoes."

What to build is ordinary. Match word stems, so that a plural finds the singular. Match near spellings. Keep a list of synonyms, and grow it from the searches that found nothing. Postgres full-text search stems words, and its trigram extension catches near spellings. When nothing matches even then, say so plainly and offer the nearest thing.

Google set the expectation. Misspell a word and it searches for the likely spelling, says so, and offers the literal version in case it guessed wrong.

Before

runing shoes

No results found.

After

runing shoes

Showing results for running shoes. Search for "runing shoes" instead

Trail running shoe, $89

Road running shoe, $74

Before, a search for "runing shoes" returns "No results found." After, the same search shows results for "running shoes", with a link to search for the original spelling instead.

Therefore:

Make search tolerate how people type: misspellings, plurals and their own names for things. When nothing matches exactly, show the nearest matches and say what you did.

In practice. Pull the last month of searches that returned nothing. Read the top fifty. Each is a typo to tolerate, a synonym to add, or a thing people expect you to have.

Goes with. The words people search with are THEIR WORDS, NOT YOURS (10), and the same list should feed PLAIN WORDS (79). A search that still finds nothing owes people ERRORS THAT HELP (77).

Example: Google's "Showing results for" and "Search instead for" lines.