This functionality is already included in the OAE APIs. Can you switch this to use Autosuggest (oae.api.util.Autosuggest).