Search Typeahead What would the API look like for the client?


#1

As discussed before, there are essentially 2 parts to this system :

  • Given a query, give me 5 most frequent search terms with the query as strict prefix
  • Given a search term, update the frequencies.

Q: What would the API look like for the client?

#2

Would the client (ie: the browser) call the updateSuggestions() function, or would that be more of a function of the server-side? I would think the latter.


#3

Get is called for every keystroke, but update is only called when you start searching (by pressing enter or search button)


#4

Should the API not take a character as input since a read call should ideally happen at each keystroke.