I am developing a search function and we have decided that users should be able to search by first name and surname. However it occurred to me that searching for (as a full name) would then return no results. So we have also decided to add it, but should full name also include any middle names?

  • 1
    Don't quite understand what the following line was meant to be: searching for (as a full name) would then return no results Oct 1, 2014 at 18:14
  • Unless it is included by the developers, searching for a full name requires an extra string that will return nothing
    – J4G
    Oct 2, 2014 at 11:17
  • 1
    You will have to develop your search function to search for partial matches and not just exact matches. Including users' middle names will be helpful if there are a lot of names and there's the possibility of multiple, identical names. If that's the case, then you might have to implement other search parameters to narrow down results (eg, school, graduation year).
    – Tim Huynh
    Nov 4, 2014 at 18:11

2 Answers 2


I am assuming you are talking about one input field that takes a first name or a surname but you want it to also be able to take a full name.

Adding in the option to search for a middle name slightly expands the options a user has for input (assuming middle name is optional) so this is definitely some improvement. There is still the much larger problem here around expecting a certain kind of input from your users.

My name is Benjamin. What would happen if someone searched for "Ben"? Would I still be found? If not, perhaps that points to a flaw in the UX here beyond the fact that someone may wish to search for my full name. Users would have to be told what they can search for and how they should use this functionality. It feels quite clunky to have to say "Search for fist name, last name or full name with optional middle names".

A much more satisfying solution would be to consider some kind of full text search with fuzzy matching. This could take away any need to educate the user on how to use it since it should work like any search input they use virtually everywhere else (search engines, most website search, Operating systems file search, etc).


Name search should work as free text search. Otherwise you are creating nasty edge cases. If someone enters multiple names (first, last, middle), split into words, and search for all of them. Or let a third-party search engine take care of it. (eg Apache Lucene)

Why? Because some people don't have middle names. Some have two or more. Some have two surnames, as is the norm in Spanish-speaking countries.

Patrick McKenzie wrote a wonderful article about these problems: Falsehoods Programmers Believe About Names

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.