Take the 2-minute tour ×
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It's 100% free, no registration required.

I'm making an app that can search Metacritic (screen-scraper app). In the search box, I have an autocomplete function, which essentially does exactly what pressing "Search" would do, which is query Metacritic and populate a listview with the results. The problem is, since the app is a screen-scraping tool, it is not instant on autocomplete like Google.

Since the autocomplete is fired on keyup (every time the value of the text field changes essentially), since it is slow, when the user finishes typing, it updates the listview a bunch of times as it keeps searching, so it keeps changing which is quite annoying as it fetches the next results. Is there a good way to get around this?

I was thinking having it only query every other keypress, so that it wouldn't update as much and therefore wouldn't be as blinky.

Update:

This fix isn't necessarily perfect, but it helps a tremendous amount. What I did was:

a) Not fire the query until the length of the text field is at least 3 b) Fire every other keypress

This removed most of the blinking.

share|improve this question
    
Your autocomplete function should kill the previous autocomplete thread (like a mutex): so you only run one autocomplete request at any one time. It would be clumsy to have it work every two characters. –  Riccardo Zorn Aug 25 '13 at 19:17
    
I considered doing that; however, my app uses Apache Cordova so I am doing the requests via AJAX. Is it possible to kill previous AJAX requests? –  Someone Aug 25 '13 at 20:36
2  
If you can't kill the query add a timer. You don't need to launch query every time a key is pressed do the autocomplete only if the user wait a little. When people type an entire word fast you don't need every partial queries. –  ColdCat Aug 26 '13 at 12:38
    
@Someone: you can kill the Ajax request with its abort() method –  Riccardo Zorn Aug 27 '13 at 5:37
    
@Someone: You might also want to ask for technical advice on stackoverflow. –  Brian Aug 27 '13 at 17:24
add comment

2 Answers

If auto-complete is slow, you can do several things:

  1. best option is to switch it off. Each user knows better than computer, what he wants to write
  2. Optimize software which is providing the auto-complete method. Common problem is, that values are read from files, then parsed, sorted, searched and after all that displayed every time a-c is accessed.
  3. Enable caching on auto-complete. Usually there are serious slowdowns, when auto-complete list should be read from the hard-drive or downloaded from Internet.
  4. Edited Enable pre-indexing. Let's have list of the a-c words extracted in the memory or quick access table in db with simple alphabetic or weight index, include background actualization according dynamic changes of the application. Enable most searched words first etc.

Unfortunately, you did not describe exactly what is the application with slow a-c, therefore it is hard to give more detailed answer.

Edited: Question is what makes your query slow. Target optimizations to that.

share|improve this answer
    
Well, believe it or not a lot of people asked me for an autocomplete feature. I can't really cache the list due to the dynamic nature of the program because I'm scraping. –  Someone Aug 25 '13 at 18:04
    
Regarding answer number 1, what on earth do you base that claim on? Can you provide any research at all to back up that claim? Autocomplete, used correctly, is a great feature to help the user ask the right question, to ensure consistent data etc. etc. –  Bluewater Aug 28 '13 at 12:12
add comment

Do you perform the search in a separate thread, so that it doesn't block the UI? If not, do this first.

Then, when results come in, don't show them if the user has already typed further characters. This should prevent the annoying multiple updates.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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