When user types in an invalid phrase in the search field (e.g. with a typo), server suggest corrections of particular words. Unfortunately, it does not suggest full phrases - only corrections to specific words.


User types in: some badlyy spelled worddz

Server suggests the following fixes:

  • badlyy - badly, bawdily, baldy
  • worddz - words, worded

How should I display these suggestions to the user?

Option 1

Mix these suggestions and display full phrases below a text field. Allow user to click them to search again. Something like "Did you mean ...?" in Google. It would result in the following suggestions:

  • some badly spelled words
  • some badly spelled worded
  • some bawdily spelled words
  • some bawdily spelled worded
  • some baldy spelled words
  • some baldy spelled worded

Pros: easy to implement.

Cons: too many options to choose from if there are many mistakes.

Option 2

Highlight invalid words with red in the text field and suggest corrections when user clicks them.

enter image description here

Pros: User can choose what to correct and what to leave.

Cons: I have not seen such solution anywhere; what should happen if user enters the field and modifies the word in red with a keyboard?

Option 3

Any ideas?

  • 1
    Option 3: leave their entry alone and execute the search with the misspellings, silently adding the corrections in as OR terms alongside the misspelled terms. (Improves recall, documents matching the most terms score highest likely aligning with query intent, searcher saves face.) Commented Sep 22, 2016 at 2:14

1 Answer 1


Actually your Option 2 is pretty common in any modern text processor. In fact nowadays its common to have Real-Time Spell Check (including Grammar Check) and Auto-Correction (the linked examples are for Office Word support but pretty much any sufficiently developed Text Processor has them). Other notable examples are IDE software for programming.

Auto complete in Mozilla

Which brings me to a preventive measure to avoid errors in text. The Auto-Complete feature (which exists in Chrome, not sure if its transverse to most browsers or search engines) is likely the most widely used method to obtain a clear search string while avoiding the appearance of any errors. Most big companies have their own technology to achieve this and you'll find some pretty high profile open-source APIs as well (check Hunspell, and also the dictionaries and languages packs if its useful to you, example: Mozilla).

As for the auto-correction feature as long as you give a quick way of returning to the literal (I mean the user input literal as opposed to correction) and point out that a change has occurred (although this is optional for most software I know) it should be a pretty efficient. A common way of returning to the literal is just pressing Ctrl+Z. Evidently this kind of automation has its downfalls. I quote Wikipedia:

In certain situations, automatic corrections can cause problems. This is particularly so in technical and scientific writing. For example, the biochemical cyclic adenosine monophosphate is commonly referred to as "cyclic AMP", which in turn is abbreviated to "cAMP". A text replacement function may regard this capitalization to be erroneous, and so change it to "Camp", which in the context of biochemistry is incorrect. Older automatic-correction algorithms can cause problems even in nontechnical writing; the Cupertino effect was an example: cooperation (which some dictionaries would not recognize unless hyphenated co-operation) became Cupertino.

So if you do opt for this kind of automation than make sure you know your users. The kind of searches they are expected to do, and how they do it (do a sentence, or just a bunch of keywords). Google search, although apparently minimalist, is quite effective at this. It allows both systems and just provides a few obvious alternatives if it detects something is wrong. This article from UX magazine might be well worth your time if you want to know more, and I quote:

Even Google, with its minimalist home page design, manages to pack more than a dozen separate features into its default search results page. These can be grouped according their primary function, such as input, informational, control, or personalization (Wilson, 2011)

In that very same article, in the summary, you can also read something that might not be at all obvious but it makes a lot of sense (take a look at the articles of Tony Russel-Rose since they deal with the problem we are now debating):

The results page plays a crucial role in the search experience, conveying to users a response to their information needs, and engaging them in a dialogue that guides them along their information journey. By drawing on a broad repertoire of layouts, views, and configurations, it can support a variety of search modes and contexts. And even when there are no results to return, or queries to reformulate, it can still facilitate productive exploration and discovery.

As so even if the search resulted zero results you can still provide some items that will enable exploration.

I don't think the possibilities you have mentioned are bad ones. In fact I think I would intuitively know how to use them which is always a good UX practice. I'm just trying to provide an universe of possibilities for your search features.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.