Sub topic 8
Retrieving and Ranking Candidate Pages
Assume you understand basic crawling, indexing, HTTP requests, and the general role of a large language model. This chapter focuses on what happens after an answer engine turns a user’s question into one or more search queries.
Retrieval finds possible sources. Ranking orders those sources by how useful they appear for the question. The language model usually receives only a limited set of top-ranked pages or passages, so ranking strongly affects which sites can be cited.
Retrieval: finding candidate pages
An answer engine may rewrite the original question into several searches. For example, “How do I rotate an API key safely?” might become searches for:
- API key rotation procedure
- API key revocation and replacement
- avoiding downtime during credential rotation
Each rewritten query can use a different retrieval method:
- Lexical retrieval matches words and phrases. It is effective when the page uses the same terminology as the query.
- Semantic retrieval compares meaning using vector representations, often called embeddings. It can find a page that says “replace credentials” when the query says “rotate API keys.”
- Entity and metadata retrieval uses recognized names, dates, authors, document types, and other indexed fields.
- Filtered retrieval applies constraints such as language, country, date, domain, or content type.
The engine combines results from these searches into a candidate set. It removes duplicates and pages that are inaccessible, obviously irrelevant, or already represented by a stronger version of the same document.
Ranking candidate pages
Ranking is a scoring process rather than a single rule. An engine may consider the following factors:
| Factor | What it measures | Common effect |
|---|---|---|
| Relevance | Match between the query and page or passage | Raises directly useful sources |
| Authority | Reputation, links, references, and source quality | Favors established or primary sources |
| Freshness | How current the content appears | Favors recent information for changing topics |
| Accessibility | Whether the crawler can fetch and parse the page | Excludes blocked or unusable pages |
| Passage quality | Whether a section answers the question clearly | Favors self-contained evidence |
A page can rank well for retrieval but still not appear in the final answer. The engine may select another page with a clearer passage, better supporting evidence, or less overlap with sources already chosen. Citation selection also depends on the answer model’s context limit and its judgment about whether a passage actually supports a claim.
Page-level implications
Write each important section so it answers one focused question without requiring hidden context. Put key definitions, conditions, dates, and exceptions near the claim they qualify. Use descriptive headings and consistent terms. A page about API key rotation should state what “rotation” means before describing the steps.
Avoid assuming that keyword repetition will improve ranking. Repetition without useful detail can reduce readability and does not replace evidence. Also avoid placing essential facts only in images, scripts, or interactive controls that a crawler may not interpret.
Exercise
Why might a semantically relevant page fail to become a cited source?
Show answer
It may rank below other candidates, lack a clear supporting passage, be inaccessible to the crawler, contain outdated information, or duplicate a stronger source.