← Melio Blog

How Search Engines Work

You type a few words, and in less time than a blink a machine sifts hundreds of billions of pages to hand you ten good answers. Here is how it really pulls that off. A picture for every idea.

01

Three Jobs, Not One

crawl, index, rank

A search engine is not one trick but three machines working in sequence. First it crawls: software robots roam the web, following links to discover pages. Then it indexes: it reads each page and files away which words appear where, building a giant catalog. Finally it ranks: when you search, it pulls every matching page from the catalog and decides the order to show them in. Crawling and indexing happen quietly for weeks before you ever type a thing. Only ranking happens in the moment you hit enter.

1. Crawl find pages 2. Index file every word 3. Rank order results first two run ahead of time · the last runs the instant you search
Every search rests on three separate jobs. Two of them finished long before you arrived.

02

Crawling: Robots Following Links

how the web gets discovered

The web has no master list of every page. So a search engine sends out crawlers (also called spiders or bots): programs that visit a page, read its content, and note every link it points to. Each new link becomes another page to visit, whose links lead to still more pages. Starting from a handful of known sites, a crawler can reach almost the entire public web simply by following links outward, hop after hop. Pages that nothing links to are hard to find, which is why a link is the web's basic act of discovery.

Picture it like → exploring a city where every doorway is a link. You walk in, write down every door you can see, then go through each one in turn. Keep going and you eventually map the whole city, without ever needing a map to start.
bot start page page A page B page C page D page E … and on
One page leads to its links, those pages lead to theirs. Following links outward, a crawler reaches almost everything.

03

Indexing: A Giant Sorted Catalog

like the index at the back of a book

Crawling gathers pages, but a pile of pages is useless for fast searching. So the engine builds an index: for every meaningful word, it stores a list of which pages contain that word. This is exactly like the index at the back of a textbook, where the word "gravity" points you to pages 12, 88, and 204. Flip that around and a search engine's index is the same idea at planetary scale: the word points to the pages, not the other way around. (Engineers call this an inverted index, because it inverts "page contains words" into "word appears on pages.")

Because the index is sorted and precomputed, answering a search is not a frantic read of the whole web. It is a quick lookup: grab the page list for each word you typed, then find the pages that appear on all of them. That precomputation is the whole reason results feel instant.

word pages that contain it "sudoku" page 4 · page 19 · page 207 … "puzzle" page 4 · page 51 · page 88 … "free" page 4 · page 19 · page 51 … all three → page 4
Each word points to its pages. Searching "free sudoku puzzle" just intersects three ready-made lists.

04

Ranking: Deciding What Comes First

relevance, authority, usefulness

For a common search, the index might return millions of matching pages. The hard part is order: which ten deserve the top of page one? The engine scores each candidate on many signals and sorts by the total. Three families of signal carry most of the weight. Relevance: do the page's words and meaning actually match what you asked, including synonyms and intent? Authority: do many other trustworthy pages link to it, treating those links as votes of confidence? Usefulness: does the page load fast, work on a phone, and give a clear, complete answer rather than a thin or misleading one?

The link idea was the breakthrough that made modern search good. A link from one page to another acts like a recommendation, and a page recommended by many well-regarded pages is probably worth trusting. This is the same instinct behind the math in how your brain weighs many small signals to build one confident picture from messy input.

Relevance matches intent Authority linked by trusted sites Usefulness fast · clear · complete one score per page sorted results
Many signals collapse into a single score per page. The pages with the highest scores rise to the top.

05

Why Results Feel Instant and Personal

precomputed, distributed, and tuned to you

Two things make a search feel almost magical. First, speed. The engine never searches the live web when you ask; it searches its index, which is split across thousands of computers that each handle a slice and answer in parallel. Because the heavy work was done in advance during crawling and indexing, the live step is just a fast lookup and sort. Second, personalization. The same query can return slightly different results for different people, shaped by signals like your location, your language, and sometimes your device or recent activity. Search "coffee" and you will see nearby cafes, not a chemistry lecture.

Personalization is real but usually modest: it mostly nudges the order and adds local results rather than rewriting the whole page. It is worth knowing it exists, because it means there is no single "correct" ranking that everyone sees. Two people can run the same words and honestly get different lists.

your query index slice 1 index slice 2 index slice 3 merged & ranked + your location < 1 sec
The query fans out across many machines at once, then results are merged, ranked, and tuned to you in well under a second.

06

Why SEO Exists, and an Honest Caveat

what ranking really rewards

Because higher ranking means more visitors, an entire practice grew up around it: search engine optimization, or SEO. At its best, SEO is just making a page genuinely easier to understand and trust: a clear title, content that actually answers the question, fast loading, a structure crawlers can read, and links earned from reputable sites. Notice that this is mostly the same list the ranking signals reward, which is the point. Engines are trying to surface pages that are relevant, trustworthy, useful, and well-linked, and good SEO is simply being those things on purpose.

An honest caveat: ranking is not a neutral mirror of truth. It favors pages that are popular and well-connected, which usually correlates with quality but not always. New or niche pages can be excellent yet sit low simply because few sites have linked to them yet. Engines also tweak their formulas constantly and keep the exact recipe secret, partly to stay ahead of people trying to game it. The honest summary: search rewards trusted, useful, well-linked pages, and most of the time, though not every time, those really are the best answers.

The Whole Story in 6 Steps

1

Three jobs. A search engine crawls, indexes, then ranks: two run ahead of time, one runs when you search.

2

Crawling. Robots follow links from page to page, discovering the web one hop at a time.

3

Indexing. Each word is filed to a list of pages that contain it, like a giant book index.

4

Ranking. Matching pages are scored on relevance, authority (links), and usefulness, then sorted.

5

Instant and personal. The index is precomputed and split across many machines, and results bend to your location and language.

6

SEO and the caveat. Good SEO is just being relevant and trustworthy, but ranking favors well-linked pages and is not a perfect mirror of truth.

Quick Glossary

Crawler: a bot that visits pages and follows their links to discover more (also called a spider).
Crawling: the discovery stage, where bots roam the web finding pages to read.
Index: the sorted catalog mapping each word to the pages that contain it.
Inverted index: the technical name for that map, since it flips "page has words" into "word has pages."
Ranking: ordering the matching pages so the best ones appear first.
Signal: any measurable clue used to score a page, such as links, speed, or relevance.
Authority: a page's trustworthiness, judged largely by who links to it.
SEO: search engine optimization, the practice of making a page easier to find and trust.

Keep Reading

How AI Really Works: From a grain of sand to a thinking machine, explained in plain language with a picture for every idea. Read →
How AI Is Actually Built: The whole stack in one walkthrough: chips made from sand, neural networks, data centers, and the push to co... Read →
How Black Holes Work: Why gravity is really a bend in space and time, and what makes a black hole a true point of no return. Read →

Browse all the Melio Blog guides →