Reading — step 1 of 5
Read
~1 min readRanking: TF-IDF & BM25
Multi-Field & Boosts
Documents have STRUCTURE: title, body, tags, author, etc. Different fields have different importance.
Indexing strategies:
Field-keyed inverted index: separate posting lists per field.
title:cat -> [doc1, doc7]
body:cat -> [doc1, doc2, doc7, doc15]
tags:cat -> [doc1]
Single-field with boosts at query time:
score = bm25(title, q) * 3.0 + bm25(body, q) * 1.0 + bm25(tags, q) * 2.0
The 3.0 / 1.0 / 2.0 are field boosts — title matches count more than body matches.
Other common scoring tweaks:
- Exact title match: very strong boost when query == title
- Recency boost: newer docs score higher (decay function on doc age)
- Popularity / clickthrough boost: docs users actually clicked rank higher
- Authority (PageRank): linked-to docs rank higher
- User personalization: re-rank based on user's history
These signals combined are how Google's ranking works — hundreds of factors blended into one score. Open-source search engines (Elasticsearch, Solr) expose mechanisms for all this; you tune for your use case.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…