Autocomplete with Friends

ios
rest
php
api

#1

Hello, I am working on an application on which people can send gifts to Twitter accounts. I am currently using users/search but it mostly returns irrelevant results.

How can I implement the desired behaviour, I am sure this has been talked over because this feels like a vital function, a search function which emphasizes user friends > followers > others

My second question is, if there is no other way than querying friends/list (which returns all friends but by paging), then it is not feasible to do this at runtime. Assume each request takes 1 second, and I have 2000 followers, max_count is 200 and the search process takes 10 seconds.

Is it bad practice (or even allowed?) if I query this in the backend for all my users when there isn’t load on my server? I’d hate this option because then I have to maintain the updates to the list, and first experience would be just as bad because the results wouldn’t be ready anyway. I also need to write search function etc. which I’d rather handle at client-side.