Add autocompletion_query function.