---
title: "How Search Engines Work: Crawling, Indexing, Ranking, and Neural AI Retrieval Architecture"
description: "Learn how search engines work from crawling and BM25 inverted indexes to HNSW dense vector retrieval, reciprocal rank fusion, and AI synthesis."
canonical_url: "https://quasarank.com/blog/how-search-engines-work"
published: "2026-10-01T03:47:41Z"
modified: "2026-11-04T00:00:00Z"
author: "Quasarank AI Research"
category: "Technical architecture"
---

# How Search Engines Work: Crawling, Indexing, Ranking, and Neural AI Retrieval Architecture

> A search engine crawls pages within a crawl budget, indexes their terms in inverted postings lists, and ranks candidates for each query. Modern systems add a dense channel that embeds queries and passages and searches them with approximate nearest-neighbour graphs such as HNSW. The two ranked lists are merged with reciprocal rank fusion and reranked by a neural model. Generative answer engines then use the top passages to ground a synthesised response.

Understanding how search engines work requires looking at two retrieval architectures running side by side: classic distributed crawling with inverted-index term ranking, and dense vector retrieval over approximate nearest-neighbour graphs that feeds generative answer synthesis. This guide walks through the stages a query passes through, the physical constraints that bound each stage, how ranked lists from sparse and dense retrievers are merged, and the open standards that govern how content is fetched and verified.

## How Search Engines Work: From Crawl to Hybrid Ranked Results

Crawling engines schedule HTTP fetch jobs within a per-host crawl budget allocation, and headless browser rendering executes the client-side scripts that build dynamic pages. Postings lists with skip pointers are the foundation of inverted-index term matching: they map each lexical term to a sorted list of document identifiers and positional offsets, which makes candidate generation fast. How raw text is segmented before indexing and embedding is explained in [what is tokenisation and subword splitting](/blog/what-is-tokenisation).

A dense retrieval channel runs beside the lexical one. Documents and queries are mapped into a shared embedding space, and approximate nearest-neighbour search over a Hierarchical Navigable Small World (HNSW) graph returns the passages closest to the query. Quantisation techniques such as IVF-PQ compress those vectors so that very large collections fit in memory. Mapping queries and passages into the same metric space addresses vocabulary mismatch—the failure of exact-term matching when a query and a relevant passage use different phrasing, which is central to [search intent optimisation across hybrid retrieval](/blog/search-intent-optimisation).

Candidate generation and multi-stage ranking run as a four-phase hybrid fusion protocol: query ingestion, dual candidate retrieval, reciprocal rank aggregation and top-K emission. When a complex prompt arrives, the router often applies [multi-branch query fanout decomposition](/blog/what-is-query-fanout-aeo-glossary) before dispatching each branch to the index shards.

### Multi-Stage Hybrid Fusion Protocol

1. **Phase 1: Ingestion and intent classification.** The routing engine parses the incoming query as a lexical, semantic or entity-lookup request and assigns candidate quotas to each channel accordingly. Parsing is kept inside a small, bounded latency budget.
2. **Phase 2: Dual-channel candidate traversal.** The lexical channel scores distributed inverted postings with BM25, which applies term-frequency saturation and length normalisation (commonly parameterised with $k_1 = 1.2$ and $b = 0.75$). The dense channel queries an HNSW proximity graph using quantised embeddings.
3. **Phase 3: Reciprocal rank aggregation.** The two ranked lists are merged into one using only rank positions, as described in the section on reciprocal rank fusion below.
4. **Phase 4: Top-K reranking and delivery.** The fused pool of top candidates is passed to a late-interaction neural reranker such as ColBERT, which produces the final ordering for the results page or generative synthesis layer.

Indexing decouples lexical tokens from dense semantic embeddings, so a single document is represented in both ways. An inverted index maps lexical terms to sorted integer postings lists that hold document identifiers and positional offsets. Late-interaction models such as ColBERT (Khattab et al., ACM SIGIR 2020) keep one embedding per token and compare query and passage tokens individually, preserving lexical specificity while absorbing continuous semantic representations.

> **Engineering Takeaway:** Dual-channel hybrid retrieval rewards documents that combine exact technical terminology for BM25 postings with self-contained conceptual explanations for HNSW dense embeddings, ensuring strong rank positions in both lists before Reciprocal Rank Fusion merges them.

| Retrieval subsystem | Indexing topology | Primary scoring metric |
|---|---|---|
| Distributed web crawler | Breadth-first priority queues and a URL frontier | Crawl politeness and server response time (TTFB) |
| Inverted index postings | Inverted lists with skip pointers | BM25 term-frequency saturation |
| Learned sparse index | Neural term expansion (for example SPLADE) | Sparse inner product of query and document term weights |
| Dense vector proximity | Multi-layer HNSW graph | Cosine similarity or L2 distance |
| Unified neural hybrid | Postings, HNSW graph and late interaction | Reciprocal rank fusion |

## Operating Limits: Crawl Budget, Latency and Memory

Every stage of the pipeline runs inside a boundary set by throughput, latency or memory. Understanding the boundary explains most of the practical failure modes technical SEO teams encounter when auditing [how Google sources and reconciles information](/blog/where-does-google-get-its-information).

### Crawl budget and server response time

Crawlers allocate a finite fetch budget to each host. When an origin responds slowly, the crawler fetches fewer pages in the same time, so server response latency (TTFB) directly limits how much of a site is crawled. Conditional requests help: when an origin returns `304 Not Modified` for unchanged resources, as described by the HTTP caching semantics in RFC 9110, the crawler spends its budget on pages that changed instead of re-downloading pages that did not.

### Memory footprint of vector search

Dense vectors are large. A 1536-dimensional embedding stored as 32-bit floats occupies 6,144 bytes, and a collection of many millions of them quickly outgrows memory. Product quantisation (PQ) compresses each vector into a short code, which cuts memory per vector by a large factor at the cost of some quantisation noise. That noise is why systems usually calibrate the result of the first retrieval stage with a more precise second-stage reranker. The neighbour-connectivity parameter of an HNSW graph, usually called $M$, trades recall and search speed against memory, and the original HNSW work (Malkov and Yashunin, IEEE TPAMI 2020) shows that hierarchical graphs give approximately logarithmic search complexity when connectivity is kept bounded.

### Behavioural signals

Ranking also uses click and interaction data. A click-feedback component such as NavBoost learns from aggregated user click streams over a long historical window, using counterfactual learning to rank to correct for position bias. Retrieval relevance alone does not decide the final ordering.

| Pipeline stage | What limits it | What happens when the limit is exceeded | Governing standard |
|---|---|---|---|
| Edge fetching | Server response time and per-host crawl budget | The crawler aborts or slows its fetches | RFC 9110, RFC 9309 |
| Headless rendering | Time and CPU available to execute page scripts | Content built late by scripts may not be indexed | Browser automation and rendering specifications |
| Lexical posting retrieval | Size of the candidate pool scanned | Candidates are truncated before reranking | Information retrieval literature |
| Vector graph traversal | Search breadth (efSearch) against required recall | Lower recall or higher latency | HNSW literature |
| Cross-encoder reranking | Batch size and accelerator capacity | Inference delay on the critical path | Neural reranking literature |

## Combining Lexical and Dense Rankings with Reciprocal Rank Fusion

Hybrid retrieval has to merge ranked lists whose raw scores are not comparable: a BM25 score and a cosine similarity live on different scales. Reciprocal rank fusion (RRF) is a ranking algorithm that combines ranked lists from several retrieval systems without any score normalisation. It was introduced by Cormack et al. (ACM SIGIR 2009). For a document $d$ and a set of retrieval channels $M = \{\text{BM25}, \text{HNSW}\}$, the fused hybrid score is:

$$\mathrm{RRF}_{\text{hybrid}}(d) = \sum_{m \in \{\text{BM25}, \text{HNSW}\}} \frac{w_m}{k + r_m(d)}$$

Here $r_m(d)$ is the rank of document $d$ in the list produced by channel $m$, $w_m$ is the channel weight, and $k$ is a smoothing constant commonly set to $60$, which damps the influence of any single outlier rank.

### Worked Numerical Example of Hybrid RRF

Suppose a hybrid search engine evaluates three candidate pages for the query *"distributed vector index memory limits"* using $k = 60$ and equal weights ($w_{\text{BM25}} = 1.0$, $w_{\text{HNSW}} = 1.0$):

- **Document A (keyword-stuffed glossary):** Ranks #1 in BM25 ($r_{\text{BM25}} = 1$) because it repeats the exact phrase, but ranks #25 in HNSW ($r_{\text{HNSW}} = 25$) due to shallow semantic coverage. Its fused score is $\frac{1}{60 + 1} + \frac{1}{60 + 25} = 0.01639 + 0.01176 = 0.02815$.
- **Document B (Conceptual academic note):** Ranks #22 in BM25 ($r_{\text{BM25}} = 22$) because it uses synonyms, and #1 in HNSW ($r_{\text{HNSW}} = 1$). Its fused score is $\frac{1}{60 + 22} + \frac{1}{60 + 1} = 0.01220 + 0.01639 = 0.02859$.
- **Document C (Technical architecture guide):** Ranks #3 in BM25 ($r_{\text{BM25}} = 3$) and #4 in HNSW ($r_{\text{HNSW}} = 4$). Its fused score is $\frac{1}{60 + 3} + \frac{1}{60 + 4} = 0.01587 + 0.01563 = 0.03150$.

Document C wins the fused ranking ($\mathrm{RRF}_{\text{hybrid}}(C) = 0.03150$) despite finishing first in neither individual index, demonstrating why consistent rank alignment across both lexical and dense retrieval outperforms single-channel optimisation.

| Dimension | Traditional inverted index (BM25) | Learned sparse index | Dense vector search (HNSW, IVF-PQ) | Unified neural hybrid |
|---|---|---|---|---|
| Core structure | Postings lists with skip pointers | Expanded sparse term inverted lists | Multi-layer proximity graph and quantised cells | Inverted postings plus HNSW graph |
| Scoring metric | Term-frequency and inverse document frequency saturation | Sparse dot product of term weights | Inner product or cosine similarity | Reciprocal rank fusion |
| Vocabulary mismatch | Vulnerable, since it requires an exact lexical match | Reduced, because contextual terms are added to the index | Largely avoided, since text is mapped into a continuous semantic space | Reduced by combining both projections |
| Memory cost | Lowest of the four | Higher than plain postings | High unless vectors are quantised | Sum of both indexes |
| Suitability for generative grounding | Lexical passage extraction | Passage scoring with term expansion | Semantic passage retrieval | Multi-stage passage retrieval with late-interaction reranking |

Retrieval-augmented generation (Lewis et al., NeurIPS 2020) is the downstream consumer of these ranked lists: the generator is conditioned on retrieved passages, so better passage ranking gives better grounding for the synthesised answer.

## Diagnosing Crawl, Index and Retrieval Failures

Three failure families account for most lost visibility in a retrieval pipeline: crawl budget starvation, index-level canonical fragmentation and vector semantic drift. A fourth, zero-click answer synthesis, affects how much of the visibility that does exist turns into attribution. You can inspect these technical signals directly with a [free website SEO and GEO audit](/audit). To see the attribution side, the [free AI visibility report](/free-visibility-report) counts how often a brand is cited when ChatGPT, Google AI Overviews, and Gemini answer three buyer prompts.

> **Diagnostic Rule:** When new or updated pages fail to appear in search or AI answers, inspect server logs for HTTP 304 conditional cache hit rates and median time-to-first-byte before rewriting page copy; crawl budget starvation blocks indexing upstream of any ranking model.

### Crawl starvation and canonical fragmentation

Slow origins starve the crawler of budget, and duplicate parameterised URLs without canonical declarations split ranking signals across near-identical pages. Search engines use near-duplicate detection, for example SimHash fingerprints, to cluster such pages, so a clear canonical URL declaration tells the indexer which version to keep. Fixing server response time and declaring canonical URLs restores crawl capacity and consolidates index entries.

### Autonomous agents and robots.txt

The Robots Exclusion Protocol (RFC 9309) is advisory: it tells well-behaved crawlers what they may fetch, but it is not an access-control mechanism, and some autonomous agents ignore it. Sites that need to refuse specific agents enforce the decision at the edge, for example by returning an HTTP `403 Forbidden` response after inspecting the user agent.

### Semantic drift and answer attribution

Dense embeddings that do not match the vocabulary of a domain produce weak grounding scores, and the usual remedy is to retrain or fine-tune the encoders for that domain. In generative answers, a document can be retrieved but not cited when the synthesis step does not attribute it. Concise direct-answer passages that state the answer plainly are easier for a synthesis step to quote and attribute.

| Failure mode | Root cause | What to inspect | Impacted subsystem | Remediation |
|---|---|---|---|---|
| Crawl starvation | Slow server responses exhaust the per-host budget | Crawl statistics and server response times | Distributed crawler | Improve edge caching and conditional responses under RFC 9110 |
| Canonical fragmentation | Duplicate parameterised URLs without canonical declarations | Near-duplicate clusters in the index | Inverted index deduplication | Declare canonical URLs consistently |
| Autonomous bot bypass | Agents ignoring robots.txt exclusions | Server logs by user agent | RFC 9309 protocol gate | Enforce user-agent rules at the edge |
| Vector semantic drift | Embeddings that do not fit the domain vocabulary | Similarity of known-relevant query and passage pairs | HNSW vector retrieval graph | Retrain or fine-tune the encoders |
| Zero-click synthesis | The generated answer omits document attribution | Whether the page is cited where it is retrieved | Generative answer engine | Add short direct answer passages |

## Standards for Crawling, Conditional Caching and Sitemap Discovery

Several public standards govern how content is fetched and how crawlers preserve host budget. The Robots Exclusion Protocol (RFC 9309) defines the syntax crawlers parse in `robots.txt`. HTTP Semantics (RFC 9110) defines conditional requests (`ETag` and `If-None-Match`) and status codes that prevent redundant transfers.

The `robots.txt` configuration below separates search and AI retrieval crawlers from faceted parameter traps while pointing crawlers to the canonical XML sitemap:

```txt
# RFC 9309 crawl budget and discovery policy
User-agent: Googlebot
User-agent: OAI-SearchBot
User-agent: PerplexityBot
Allow: /
Disallow: /search?
Disallow: /*?sort=
Disallow: /*?filter=

Sitemap: https://acme-analytics.example/sitemap.xml
```

When a crawler revisits an indexed URL, serving strong `ETag` validators under RFC 9110 allows the origin to short-circuit unchanged responses with `304 Not Modified`, freeing crawl budget for newly published documentation:

```http
GET /docs/hybrid-retrieval-architecture HTTP/2
Host: acme-analytics.example
User-Agent: Googlebot/2.1 (+http://www.google.com/bot.html)
If-None-Match: "sha256-9f86d081884c7d659a2feaa0c55ad015"
If-Modified-Since: Mon, 05 Oct 2026 10:00:00 GMT

HTTP/2 304 Not Modified
Date: Tue, 06 Oct 2026 14:12:00 GMT
ETag: "sha256-9f86d081884c7d659a2feaa0c55ad015"
Cache-Control: public, max-age=3600, stale-while-revalidate=86400
```

| Standard | Governing organisation | Scope | Practical effect |
|---|---|---|---|
| RFC 9309 | IETF | Crawler access rules in `robots.txt` | Directs compliant crawlers away from parameter traps |
| RFC 9110 | IETF | HTTP semantics, `ETag` validators and conditional requests | Preserves crawl budget through deterministic `304` responses |
| W3C JSON-LD 1.1 | W3C | Linked data graphs for entity disambiguation | Supplies unambiguous entity identifiers to knowledge graphs |
| ISO/IEC 23053 | ISO/IEC JTC 1/SC 42 | Framework for machine-learning systems | Provides common terminology for neural retrieval pipelines |

To see how these retrieval indexes power production search surfaces, explore [where Google gets its information across six retrieval layers](/blog/where-does-google-get-its-information) and our architectural guide to [search intent optimisation in dual-channel neural retrieval](/blog/search-intent-optimisation).

## Frequently Asked Questions

### How do search engines combine keyword indexes with dense vector search?

Search engines run lexical inverted indexes and dense vector graphs in parallel for each incoming query. The BM25 index retrieves documents containing exact keyword and identifier matches, while the HNSW vector index retrieves semantically related passages by embedding similarity. Reciprocal Rank Fusion then merges both ranked lists into one candidate pool for cross-encoder reranking.

### Why is Reciprocal Rank Fusion (RRF) used in hybrid search engines?

Reciprocal Rank Fusion combines rankings from sparse BM25 indexes and dense vector graphs without requiring raw score calibration. Because unbounded lexical scores and bounded cosine similarities exist on incompatible mathematical scales, linear score blending causes unstable rankings. RRF uses only ordinal rank positions with a smoothing constant, rewarding documents that perform consistently across both retrieval channels.

### How does crawl budget affect visibility in both Google Search and AI engines?

Crawl budget governs how many URLs an automated crawler fetches on a host within a scheduled window. High server response latency, duplicate parameter URLs, and missing HTTP 304 conditional caching waste finite fetch quotas on redundant bytes. When crawlers cannot fetch updated pages promptly, neither traditional search indexes nor real-time AI retrieval pipelines can cite them.

## References

- [Robots Exclusion Protocol (RFC 9309) — IETF, 2022](https://www.rfc-editor.org/rfc/rfc9309)
- [HTTP Semantics (RFC 9110) — IETF, 2022](https://www.rfc-editor.org/rfc/rfc9110)
- [Reciprocal Rank Fusion Outperforms Condorcet and Individual Rank Learning Methods — Cormack et al., ACM SIGIR, 2009](https://dl.acm.org/doi/10.1145/1571941.1572114)
- [Efficient and Robust Approximate Nearest Neighbor Search Using HNSW Graphs — Malkov and Yashunin, IEEE TPAMI, 2020](https://arxiv.org/abs/1603.09320)

