How search works
How search engines workThe five steps from discovery to rankingComponentsThe parts that make a search engine runCrawlingHow bots find and fetch your pagesIndexingHow a page gets stored so it can be foundCheck if indexedFour ways to confirm a page is on GoogleCrawling and indexing
Web crawlersGooglebot, Bingbot and the new AI botsGooglebotHow Google's crawler reads your siteRobots.txtRules, examples and a free testerXML sitemapCreate one, then submit it to GoogleCanonical tagPick the main version of a pageNoindex tagKeep a page out of search resultsRanking and results
Search engine rankingWhy one page appears above anotherGoogle ranking factorsWhat really matters, grouped simplyPageRankHow links pass value between pagesAlgorithmsTF-IDF, PageRank and modern rankingResults page (SERP)What each block on the page is forAI searchHow AI answers are built from the indexUnderstand
What is a search engineA plain definition with real examplesTypes of search enginesCrawler, meta, vertical, private and AIBrowser vs search engineTwo tools that people often mix upExplore
Best search enginesGoogle, Bing, DuckDuckGo and moreUses of search enginesThe everyday jobs that search handlesHistory of search enginesFrom Archie in 1990 to AI answersSearch engine algorithms are the sets of rules a search engine uses to decide which pages best answer a query. Modern engines stack several of these methods in layers, from simple word matching to link analysis, then to machine learning that reads meaning. This guide explains each layer with small examples, covers the major Google systems by name, then shows what it all means for anyone running a website.
A search algorithm scores pages by combining several methods, such as BM25 word matching, PageRank link analysis and machine learning systems like RankBrain or BERT. Quality systems sit on top of these layers, while core updates adjust how the layers are weighed.
The big picture
An algorithm is simply a recipe: a fixed set of steps that turns ingredients into a result. In search, the ingredients are a query plus billions of stored pages, while the result is an ordered list.
No single formula does all the work. Engines run a fast, cheap method first to find candidates, then apply slower, smarter methods to the shortlist. Each layer answers a different question about the page, which is why they are easiest to understand one at a time.
If you are new to the topic, start with our hub on search engine ranking, which explains the signal families these layers try to measure.
Layer 1
The word lexical simply means “to do with words”, which describes this layer well. These formulas are the oldest layer in search, yet they still help engines pull a first set of candidates quickly.
TF-IDF stands for term frequency times inverse document frequency. Term frequency counts how often a word appears on a page. Inverse document frequency rewards words that are rare across the whole collection, because a rare word tells you more about a page than a common one.
A tiny worked example makes the idea much clearer. Imagine an index of 1,000 pages where “recipe” appears on 500 of them, while “pie” appears on only 20. Using a simple logarithm, “recipe” earns a rarity weight of about 0.3, whereas “pie” earns about 1.7. The word pie is therefore far more useful for spotting a page about pie.
BM25 is a refined version of the same idea that has been a standard in information retrieval for decades. It adds two sensible corrections to the basic formula. First, repetition has diminishing returns, so the tenth mention of a word on the same page adds very little. Second, it adjusts for length, which stops a very long page from winning just because it contains more words.
Word matching cannot tell that “cheap flights” and “low-cost airfares” mean the same thing. That gap is exactly what later layers were built to fill.
Interactive · Two classic algorithms
Type a search to see how word scoring ranks three tiny pages, then switch tabs to watch PageRank pass votes along links.
| Word | Pages with it | Rarity weight | Page A | Page B | Page C |
|---|
Layer 2
Word matching says what a page is about. Link analysis asks a different question: how much do other pages trust it?
PageRank was described by Larry Page and Sergey Brin in 1998, in their Stanford paper on the prototype that became Google. The idea treats every link as a vote. A page linked from many places gains importance. Votes are not equal, though, because a link from an important page counts for more than one from an obscure page.
When page X links to page Y, part of X’s importance flows to Y, much like a recommendation from a respected friend.
A link from a major news site carries more weight than one from a brand-new blog with no visitors.
A page with five outgoing links shares its vote five ways, so each link passes a smaller share.
PageRank imagines a person clicking links at random. Pages that this surfer lands on most often score highest.
Links proved so useful that people began buying or faking them, which led engines to develop spam detection for unnatural links. Google still lists link analysis, including PageRank, among its ranking systems, although the modern version is very different from the original paper.
Layer 3
Semantic matching means matching by meaning instead of by exact words. Since the mid-2010s, Google has added machine learning systems that do this at scale.
Machine learning is a way of building software that learns patterns from examples instead of following hand-written rules. For search, a system can learn that “how to fix a dripping tap” and “repair leaking faucet” describe the same problem without sharing a word.
| System | Announced | What it does in plain words |
|---|---|---|
| RankBrain | 2015 | Helps relate words to concepts, which is especially useful for searches Google has never seen before |
| BERT | 2019 | Reads each word in the context of the words around it, so small words like “to” or “for” change the meaning correctly |
| MUM | 2021 | A larger model that works across languages and formats, which Google says it uses for specific tasks rather than general ranking |
Google’s own BERT example shows why this matters. For a search like “2019 brazil traveler to usa need a visa”, older systems could miss the word “to”, then return pages about Americans travelling to Brazil. BERT helped Google understand that the traveller was going from Brazil to the United States.
Putting it together
Once an engine has dozens of scores for each page, it still needs a way to combine them. Machine learning usually handles that blending step as well.
This technique is often called learning to rank. Engineers give a model many examples of queries alongside results judged good or poor, then the model learns how to weigh signals so that good results rise. The finished model can then score pages for queries it has never seen.
The raters follow a public document called the Search Quality Rater Guidelines. Reading it is one of the clearest ways to understand what Google means by helpful, trustworthy content.
Layer 4
Relevance alone is not enough, because spam pages can be relevant too. Quality systems try to separate genuinely useful pages from thin or manipulative ones.
Targeted thin, low-value content, such as pages written mainly to attract clicks. It later became part of Google’s core systems.
Targeted manipulative link schemes, which reduced the benefit of buying or swapping links in bulk.
Aimed to reward content written for people rather than for search engines. Google folded it into its core ranking systems in 2024.
Several times a year, Google announces broad changes to how its systems assess content across the whole web.
A core update rarely targets one site. Instead, it adjusts how the existing layers are weighed, so some pages rise while others fall. Google’s advice after a drop is consistent: review whether your content is still the most helpful answer, rather than looking for a quick technical fix.
One search, start to finish
To see the layers in action, follow a single query from the search box to the results page.
Each step depends on the page having been crawled and indexed first. Our guide to the components of the system shows which part handles each stage, while the full search engine basics guide ties every concept together.
Practical takeaways
You cannot see inside any search algorithm, yet each layer rewards fairly predictable things. Working with them is far more reliable than trying to outguess them.
| Layer | What it rewards | What you can do |
|---|---|---|
| Word matching | Pages that use the words searchers use | Name the topic clearly in the title, headings and opening lines |
| Link analysis | Pages that others genuinely cite | Publish something worth referencing, then link to it from your own related pages |
| Semantic matching | Pages that cover the real question | Answer follow-up questions, using natural language rather than repeated keywords |
| Quality systems | Pages made for people, with real expertise | Show first-hand experience, cite sources, then keep facts up to date |
| Core updates | Pages that stay the best answer over time | Review important pages after each update instead of chasing quick fixes |
None of these layers can be gamed for long, because each new system is designed to close the gaps the previous one left open. Clear, accurate pages that answer a real question have been the safest long-term approach through every change listed above.
FAQ
It is a set of rules that scores pages for a query, then sorts them so the most useful ones appear first. Real engines combine many such methods together.
Google says link analysis, including PageRank, is still one of its ranking systems. The modern version has changed a great deal since the original 1998 paper.
RankBrain, announced in 2015, helps connect words to broader concepts. BERT, introduced to Search in 2019, reads each word in the context of the whole sentence.
Small changes happen almost daily, while Google announces broad core updates several times a year. Larger updates are listed on the Google Search Status Dashboard.
BM25 remains a common baseline for word matching in many search systems. Large engines typically combine it, or methods like it, with machine learning layers.
Keep learning