Skip to content
Technical architectureSearch engineInformation retrievalNeural retrieval

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

Quasarank AI ResearchUpdated 11 min readMarkdown (.md)

Direct answer

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.

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.

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 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 k1=1.2k_1 = 1.2 and b=0.75b = 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 subsystemIndexing topologyPrimary scoring metric
Distributed web crawlerBreadth-first priority queues and a URL frontierCrawl politeness and server response time (TTFB)
Inverted index postingsInverted lists with skip pointersBM25 term-frequency saturation
Learned sparse indexNeural term expansion (for example SPLADE)Sparse inner product of query and document term weights
Dense vector proximityMulti-layer HNSW graphCosine similarity or L2 distance
Unified neural hybridPostings, HNSW graph and late interactionReciprocal 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.

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.

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 MM, 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 stageWhat limits itWhat happens when the limit is exceededGoverning standard
Edge fetchingServer response time and per-host crawl budgetThe crawler aborts or slows its fetchesRFC 9110, RFC 9309
Headless renderingTime and CPU available to execute page scriptsContent built late by scripts may not be indexedBrowser automation and rendering specifications
Lexical posting retrievalSize of the candidate pool scannedCandidates are truncated before rerankingInformation retrieval literature
Vector graph traversalSearch breadth (efSearch) against required recallLower recall or higher latencyHNSW literature
Cross-encoder rerankingBatch size and accelerator capacityInference delay on the critical pathNeural 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 dd and a set of retrieval channels M={BM25,HNSW}M = \{\text{BM25}, \text{HNSW}\}, the fused hybrid score is:

RRFhybrid(d)=∑m∈{BM25,HNSW}wmk+rm(d)\mathrm{RRF}_{\text{hybrid}}(d) = \sum_{m \in \{\text{BM25}, \text{HNSW}\}} \frac{w_m}{k + r_m(d)}

Here rm(d)r_m(d) is the rank of document dd in the list produced by channel mm, wmw_m is the channel weight, and kk is a smoothing constant commonly set to 6060, 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=60k = 60 and equal weights (wBM25=1.0w_{\text{BM25}} = 1.0, wHNSW=1.0w_{\text{HNSW}} = 1.0):

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

Document C wins the fused ranking (RRFhybrid(C)=0.03150\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.

DimensionTraditional inverted index (BM25)Learned sparse indexDense vector search (HNSW, IVF-PQ)Unified neural hybrid
Core structurePostings lists with skip pointersExpanded sparse term inverted listsMulti-layer proximity graph and quantised cellsInverted postings plus HNSW graph
Scoring metricTerm-frequency and inverse document frequency saturationSparse dot product of term weightsInner product or cosine similarityReciprocal rank fusion
Vocabulary mismatchVulnerable, since it requires an exact lexical matchReduced, because contextual terms are added to the indexLargely avoided, since text is mapped into a continuous semantic spaceReduced by combining both projections
Memory costLowest of the fourHigher than plain postingsHigh unless vectors are quantisedSum of both indexes
Suitability for generative groundingLexical passage extractionPassage scoring with term expansionSemantic passage retrievalMulti-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. To see the attribution side, the free AI 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 modeRoot causeWhat to inspectImpacted subsystemRemediation
Crawl starvationSlow server responses exhaust the per-host budgetCrawl statistics and server response timesDistributed crawlerImprove edge caching and conditional responses under RFC 9110
Canonical fragmentationDuplicate parameterised URLs without canonical declarationsNear-duplicate clusters in the indexInverted index deduplicationDeclare canonical URLs consistently
Autonomous bot bypassAgents ignoring robots.txt exclusionsServer logs by user agentRFC 9309 protocol gateEnforce user-agent rules at the edge
Vector semantic driftEmbeddings that do not fit the domain vocabularySimilarity of known-relevant query and passage pairsHNSW vector retrieval graphRetrain or fine-tune the encoders
Zero-click synthesisThe generated answer omits document attributionWhether the page is cited where it is retrievedGenerative answer engineAdd 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:

Plain text
# 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
StandardGoverning organisationScopePractical effect
RFC 9309IETFCrawler access rules in robots.txtDirects compliant crawlers away from parameter traps
RFC 9110IETFHTTP semantics, ETag validators and conditional requestsPreserves crawl budget through deterministic 304 responses
W3C JSON-LD 1.1W3CLinked data graphs for entity disambiguationSupplies unambiguous entity identifiers to knowledge graphs
ISO/IEC 23053ISO/IEC JTC 1/SC 42Framework for machine-learning systemsProvides 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 and our architectural guide to search intent optimisation in dual-channel neural retrieval.

Frequently Asked Questions

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

Cite this article

BibTeX
@misc{quasarank2026howsearchengineswork,
  author = {{Quasarank AI Research}},
  title = {How Search Engines Work: Crawling, Indexing, Ranking, and Neural AI Retrieval Architecture},
  year = {2026},
  howpublished = {\url{https://quasarank.com/blog/how-search-engines-work}},
  note = {Published 2026-10-01}
}
APA
Quasarank AI Research. (2026, October 1). How Search Engines Work: Crawling, Indexing, Ranking, and Neural AI Retrieval Architecture. Quasarank. https://quasarank.com/blog/how-search-engines-work

Run a free technical SEO audit of your site

See pricing plans