BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
Data Science

Information retrieval: How search finds documents

Information retrieval is the science behind search: finding and ranking the documents most likely to meet a searcher's need, from keywords to meaning.

Monthly searches · information retrieval
8.1k
Keyword research data
information retrieval
Information retrieval: How search finds documents
Click the image to view it full size

Information retrieval (IR) is the field of computer science that studies how to find the documents that best meet someone's information need, from a large collection, and return them in order of likely usefulness. Web search engines are its best-known application, but the same ideas run site search, library catalogs, email search and the retrieval step behind AI assistants.

The key word is ranked. A database query returns exactly the rows that match a condition. An IR system returns a list ordered by how relevant each document probably is, because "relevant" has no exact definition and the searcher can only describe what they want in a few words.

The basic vocabulary

IR textbooks use a few terms that are worth knowing, because SEO borrows them:

  • Information need: what the person actually wants to know or do.
  • Query: the words they type to express it, often a poor summary of the need.
  • Document: whatever unit the system indexes and returns: a web page, a product, a paragraph.
  • Collection (or corpus): all the documents the system searches. For web search, that's the indexed web.
  • Relevance: how well a document meets the need, not just whether it contains the words.

How a retrieval system works

Every IR system, from a site search box to Google, follows the same broad steps.

  1. Indexing. Before anyone searches, the system processes the documents: it splits text into terms, may normalize them (lowercase, stemming), and stores them in an inverted index. That's a list of every term with the documents it appears in, like the index at the back of a book, so the system never has to read every document at query time. See indexing for how this works in Google.
  2. Query processing. The system interprets the query: corrects spelling, recognizes names and phrases, and may expand it with related terms.
  3. Matching and scoring. It finds candidate documents and gives each a relevance score for the query.
  4. Ranking. It sorts by score, usually with further signals on top, and shows the results with a title and snippet for each.

The interesting part is step 3: how the score is calculated.

Keyword matching: sparse retrieval

The classic approach represents each document and query by the words they contain. Each word gets a weight: words frequent in the document count more, and words that appear in almost every document count less. The best-known weightings are TF-IDF, built on inverse document frequency, and BM25, introduced with the Okapi system in the 1990s. Comparing the query's word weights with each document's, as in the vector space model, gives the score.

This is called sparse retrieval, because each document's list of possible words is mostly zeros. It's fast, easy to explain and very good at exact matches: product codes, names, rare technical terms.

Its weakness is the vocabulary mismatch problem: the searcher has to guess the words the writer used. A page about "cushioned insoles" won't match a query for "comfortable shoes for standing all day" if only shared words count.

Meaning-based matching: dense retrieval

Dense retrieval tackles vocabulary mismatch. A language model turns the query and each document, or each passage of a document, into an embedding: a list of numbers that places texts with similar meaning close together. The system then looks for the documents nearest to the query, often with a vector database. This is the basis of semantic search and vector search.

Dense retrieval handles synonyms and paraphrases well. Keyword matching stays useful for exact names and codes, so the two approaches are often combined.

Google doesn't publish its scoring formulas, but it names many of its ranking systems, and several are IR in action (Google Search Central):

  • BERT helps Google understand how combinations of words express meaning. When Google applied it to Search on 25 October 2019, it affected about one in 10 US English searches. Google's examples were queries where a small word such as "to" changes the meaning.
  • Neural matching relates concepts in queries to concepts in pages.
  • Passage ranking judges individual sections of a page, not only the page as a whole.
  • RankBrain helps return relevant pages even when they don't contain all the words of the query.
  • Link analysis and PageRank add signals that classic text retrieval doesn't have, from how pages link to each other.

What this means for your pages

You don't need to calculate TF-IDF to benefit from understanding retrieval. The practical points:

  • Use the words your readers use. Google's starter guide suggests thinking about how both experts and beginners would search for your topic. Exact matches still matter for names, products and technical terms.
  • Don't force every variation in. Google says its language matching can relate a page to queries that don't use its exact terms. Repeating keyword variants only makes the page worse to read.
  • Give each section one clear job. Retrieval increasingly works on passages, and Google's passage ranking looks at individual sections. A section with a clear heading and a direct answer can stand on its own.
  • Get indexed first. No retrieval method can rank a page that isn't in the index, so crawlability comes before everything else.

How retrieval quality is measured

IR researchers measure systems with two numbers. Precision is the share of returned documents that are relevant. Recall is the share of all relevant documents that were returned. Ranked systems use versions of these that reward putting relevant documents near the top.

Shared test collections make comparisons fair. The best known is TREC, the Text REtrieval Conference run by the US National Institute of Standards and Technology since 1992 (NIST).

Information retrieval and AI answers

AI assistants that answer from the web use IR as their first step. In retrieval-augmented generation, a retriever finds relevant documents or passages, and a large language model writes an answer based on them, often citing the sources. A page that can't be retrieved can't be cited, so the same basics apply: clear passages, the words people use, and pages search engines can crawl.

Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.