0

I have a free text box that provides the ability to search for other users.

You can type anything you like into the box (part of the name, email address, job title...etc) and it will provide a list of results.

However the search is fairly slow, takes around 30 seconds (working on improving this).

So I detect if what is entered is a username, if so I can get the user instantly.

How do I indicate to the user that they can search for anything they might know, if however they know the username it is a much better option, because it is orders or magnitude faster?

I've thought of just writing a little note to say this, but I wondered if there's a more natural way to suggest it.

3 Answers 3

1

I know this is probably out of your control, but 30 seconds is really long. There probably is no index on the fields in the database that is not a username. Tell the developer to add an index and things would go much faster.

Solution 1: Add an advanced search button

In terms of UI, you are talking about a search-as-you-type (type-ahead) kind of field, which assumes that users will see results while they are typing. Because that's not possible when searching for non-usernames, I would not offer that functionality on a non-username search. This means I would offer a search field with "Search for username" as label and an "advanced search" button opening a second field allowing to search for non-usernames. The second field would not be a type-ahead type of field, so you'll need to add a submit button.

This is a clunky solution, but better aligned with expectations of the user who expects instant results when using a type-ahead field.

Solution 2: Execute 2nd search when user stops typing

A more complex solution would be to perform the non-username search after the username search. This means that the list of results would first show matching usernames followed by an entry with a spinner with text: "searching in names, job titles,...". So, when you search "jo", the results list would show:

  • John
  • Johnathan
  • Johanna
  • (spinner) searching across first name, last name,...

When the 30 second non-username search is complete the spinner disappears and the results are added to the list. You will have to play with the delay times (times between typing and executing a search request) to get the experience right. I suggest executing the username search very quickly while typing, and execute the non-username search when the user stops typing. Otherwise your server will be hit with several request (for each character typed) that will take 30 seconds and your server will be under a lot of stress.

This suggestion assumes you can successfully hook into the type-ahead functionality often offered out-of-the-box by popular front-end libraries. This may be harder than my first suggestion to develop.

But let me repeat again, a 30 second search is extremely long. Unless you are dealing with searching within millions of records on a slow server, it would probably be easier to fix the database scheme than "solve" it on the UI level. The other thing is, usernames, first names etc. don't change that often, so things can be heavily cached. Adding an database index to these fields basically means you tell the database to create a cache against these fields.

0

If you are using a form input, the placeholders and helper text are your friend here. Use clear and concise microcopy to tell the user what kind of search terms your form accepts would be a good start.

enter image description here

2
  • 1
    For clarity I would combine the helper text and placeholder into something like: @username (fastest), name, email, job title....
    – Carmax
    Commented Oct 3, 2019 at 23:19
  • Problem with this solution is that the search for name, email, job title takes 30 seconds, and OP wants to encourage users to search by username first.
    – bart
    Commented Mar 1, 2020 at 23:01
0

I would go with next placement: Label: Instant search by username Sublabel: Or search by job title, email... (takes 30sec to find) Placeholder in field: Enter Username, Job title, Email...

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.