I am building a web app where the user is able to search for a location and the possible spots are drawn from a database that numbers around 10,000. I would like to use the jQuery UI autocomplete plugin for this and am wondering if it is realistic to load 10,000 sites into an array that it searches from. If not what can I do to make it work and speed it up.
Thanks!
you probably don’t want to send 10,000 locations to each browser. check out: http://jqueryui.com/demos/autocomplete/#remote
jquery will send the partial string to the server once it passes 2 characters (in that example). you then send back 10 or so matches. as the user types in more characters, the matches are more refined until the user sees the one they want.
i’ve done this with substring matches as well, although the fast and typical way to do this is by matching the start of the string.
on the server side, you probably want to cache the matches somehow.