1

Since search engines don't go through every webpage on the internet when searching for something, how are they able to find an exact string of words? For example, using quotes in Google, like "apples bananas pears" will only show results that contain those three words in that exact order.

closed as unclear what you're asking by gnat, Doc Brown, Bart van Ingen Schenau, user40980, GlenH7 Sep 27 '15 at 17:26

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
  • 2
    The short answer is that search engines do search the entire text of every web page on the internet. They just use indexes to do it efficiently so they don't look at every page. Keyword indexes will tell Google which pages contain all three words "apples bananas pears" and then these pages can be looked at in more detail to see if the words are adjacent (this is a simplification, of course). – user82096 Sep 26 '15 at 6:09
  • @dan1111 Thank you. I'm surprised that doesn't take an extremely long time. I'd imagine something like "a a" would take forever. – Michael Blake Sep 26 '15 at 7:00
  • @MichaelBlake, also remember that search engines don't have to find all the results, just enough to populate the first page of results. Ranking algorithms are designed such that the entire search need not be completed to identify the top results. There are other optimisations as well. I'm no expert on this, though. – user82096 Sep 26 '15 at 8:18
0

Never underestimate how much computing power may be brought to bear on a problem.

A web crawler typically pulls down the entire web page and all linked or included pages and creates indices and rankings several times the original size of the web page. Somewhere, it keeps a copy of the entire page as well. Google is known for having the largest backup of the 'deep' webpages for obscure searches.

To do a full text search, a faster service typically does a search without the quotes and then filters the results. It will not find all hits, but users are usually happy if one of the first two results are relevant. In some cases, the results are a bit slower as the filtering eliminates a lot of responses.

So power. And cheating.

Not the answer you're looking for? Browse other questions tagged or ask your own question.