0

I have a site with a search bar. When a user enters a query in the input field and clicks the submit button, front-end JavaScript searches some JSON and returns results based on their search.

In this system, some queries load the exact same results.

The results load very quickly (2 milliseconds) but if the same results were loaded, then it looks like the search query did not run.

  1. How can I make it obvious to the user that the search has still happened? Is flashing the results text a good idea? Should I have a timestamp?
  2. Would displaying the number of results and how long it took to fetch the results a good idea? In my case, the search algorithm consistently takes exactly 2 milliseconds to run, and only a maximum of 7 results are shown, making this look like a silly idea.
1
  • 1
    It might be worth considering forcing a loading animation to show for a minimum amount of time. Even 0.5 seconds would be enough to give visual feedback that the results are fresh. And I doubt you have to worry about anybody complaining that a 0.5 second wait is too long.
    – musefan
    Aug 3, 2020 at 13:19

1 Answer 1

4

I can think of some things to make it more obvious that the search has been triggered:

  • Flash the search results
  • Flash a light yellow background behind the search
  • Add a label on top of the results "Search results for 'ux stackexchange'"
  • Add a timestamp label "Last search: 2 seconds ago"

I don't think it is interesting for the user to know how long the search took.

2
  • I don't think it is interesting for the user to know how long the search took. I suggested this because Google displays this information. I wonder why? Aug 3, 2020 at 14:01
  • 3
    I guess because they want to brag about how fast they can search the web compared to competitors.
    – Nash
    Aug 3, 2020 at 14:58

Your Answer

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

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