I'm deploying an instant search on my Windows app. At the first implementation, when the user types a key, the search engine makes a query and returns the results. I thought that that wasn't too efficient, because when the user wants to search for a long word, each character makes a query, so I made the search start a bit delayed, to let the user write the full word before it starts to query and loads the results in the table. More efficient, less glitch when the rows are reloaded.
Is this a good practice anyway? Is there any convention about it? I'm seeking for a case study about how much milliseconds that delay should be, but I didn't find anything. A short one, and the application will make a lot of queries when the user types slowly. A long one, and the user will perceive the application as slow in loading data.
Answer
Yes, this is excellent practice. It can even improve the responsiveness of your application, because doing the actual search on every key press can cause delays in itself.
I have build a component (that we're using all over the place for this and similar purposes) that basically sets two times: a minimum time to wait for more input, and a maximum time from the first input to start performing the action. The minimum timer is reset with each edit of the input, the maximum time is only reset on the triggering of the action (the search, in your case.) That way, you avoid the situation you describe. Response to this setup in the applications I have build has been very good.
I guess the ideal timings depend on the exact use case and the audience, but I'm using values in the range of 0.1s for the minimum wait, and 0.8s for the maximum.
No comments:
Post a Comment