How does Google Chrome Omnibox autocomplete work?

The comment in the following post is especially useful for understanding a part of the algorithm.

How does the Chrome update URL bar end?

But questions remain here. I did some experiments in Chrome:

  • When I enter "eddit", it offers only "reddit" for general google search, and if I completely enter "reddit", then the historical reddit url appears.

  • If I enter the substring “facebook” or “google” or “youtube” then the URLs will be deleted successfully. Say "ceb", "ogl", "utu". Therefore, attempts should not be (only) the data structure used here.

In addition, I know that Chrome uses sqlite fts for full-text search (the sqlite fts 3/4 attribute for Google). Therefore, I assume Chrome uses an inverted url index in sqlite.

My question is:

How can Chrome autofill "utu" → "youtube"? (based on my local urls)

  • I know that a suffix array / tree can efficiently fine-tune a substring. But the search for the specific word "youtube" will be linear.
  • I assume that a specially designed tokenizer (for fts3 / 4) can be used for this. Say "google" → {"g", ..., "gle", ..}. But too many tokens will be created.
+4
source share

All Articles