[Yujun] Added one method for autocomplete.
(cherry picked from commit 18c1a5e)