liveBook · Manning

Retrieval ranking

As explained in AI-Powered Search

Search ranking is the process of ordering retrieved items according to their estimated usefulness or relevance to a query.

Ranking orders search results by estimated relevance to a query. A search engine indexes content, finds possible answers, then scores and sorts them so the strongest matches appear first. A score might reflect keyword matches or similarity between numerical representations of a query and a document. The scoring function can be adjusted for individual queries. section 3.0

Keep matching and ranking distinct. Matching filters documents to a set of possible answers; ranking scores and orders those answers. Filtering first can avoid scoring every document and supports counts and facets for exploring results. But a condition used as a filter removes documents outright, while a scoring feature changes their order. section 3.2.4 section 3.2.6

Books for a young audience

For a query such as “the cat in the hat,” filter to documents whose category is books and whose audience is kid. Requiring every query word in the description narrows the candidates further. The query can then score those candidates by relevance. If the words should influence order without excluding documents, use them as a scoring feature instead of a required match. section 3.2.6

Generic search request syntax:
 {"query": "the cat in the hat",
  "query_fields": ["description"],
  "filters": [("category", "books"), ("audience", "kid")],
  "min_match": "100%"}

Solr request syntax:
 {"query": "the cat in the hat",
  "filters": ["category:books", "audience:kid"],
  "params": {"qf": ["description"],
             "mm": "100%",
             "defType": "edismax"}}

Compare the generic request with its Solr form: category and audience are explicit filters, while the query also filters and contributes to scoring. section 3.2.6

That dual role of the query parameter is convenient but can make advanced tuning harder. In Solr, filters can control eligibility while a boost query (`bq`) contributes to relevance without filtering. This lets a team change the ranking signal without unintentionally shrinking the result set. section 3.2.6

Generic text scores are a starting point, not a complete relevance strategy. Restaurant results may need proximity and dietary preferences; news may need freshness; product search may value likelihood of purchase. Add such domain-specific signals deliberately, and check whether filtering or scoring best expresses each requirement. section 3.3 section 3.2.6

How AI-Powered Search covers it

How deep it goes
Explains scoring versus filtering, query-parameter behavior, and configurable domain signals without detailing a complete relevance-tuning procedure.
Examples
Uses a children’s-book query with category and audience filters, plus restaurant, news, and e-commerce ranking signals.
What it assumes
Assumes indexed documents and incoming queries while defining the distinction between matching and ranking.
What you can do after
Apply it via Solr query, filter, and boost-query parameters to control which documents qualify and how they rank.
How it connects
Connects ranking to matching, vector similarity, keyword relevance, facets, boost queries, and domain-specific relevance.

Also explained in

Compare how 4 books explain retrieval ranking →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Search. The section links point to the parts of the book it draws on.