Does search engines like Google or Bing search through all web pages for a single query every time?

Here is what I imagine would happen when I type in a search query in Google or Bing:

  1. The search query is converted into a vector through some pre-trained machine learning models. The vector captures semantics features, etc.

  2. The search engine goes through all webpages that it has ever crawled and computes a similarity score of each webpage to my search query based on the vectors of a query and the webpage. (Assuming the search engine have already pre-computed the semantics feature vector for all webpages that it crawled)

  3. The search engine ranks the similarity scores of all the webpages, and return the ranked list to me.

To me, it just seems that searching through all webpages would be too expensive and I find it hard to believe the searching and ranking are all done in a few milliseconds.

Can someone comment?