BM25 Algorithm
Last updated
What is BM25 Algorithm?
BM25 (Best Matching 25) is a ranking function used by search engines to estimate the relevance of documents to a given search query. It's a bag-of-words retrieval function that scores documents based on the query terms appearing in each document, taking into account term frequency and document length. The algorithm adjusts for document length, preventing longer documents from being unfairly favored, and also considers how frequently a term appears in the entire collection of documents.
Free resources to learn BM25 Algorithm
- Official docsPractical BM25 - Part 1: How Shards Affect Relevance Scoring in Elasticsearch
- Official docsPractical BM25 — Part 2: The BM25 Algorithm and its variables
- Official docsPractical BM25 - Part 3: Considerations for Picking b and k1 in Elasticsearch
- Official docsImproved Text Scoring with BM25
- ArticleOkapi BM25
More in stage 7: Search Analyzer
- Search Analyzer
- Doc values
- fielddata
- The Inverted Index
- The Analyze API
- Standard Analyzer
- Custom Analyzers
- Value Count
- Avg / Sum / Min / Max
- Cardinality
- Stats / Extended Stats
- Terms
- Range / Date Range
- Histogram
- Filter Aggregations
- Pivot
- Latest
- Transform API
- Nested Aggregations
- Pipeline Aggregations
- Understanding Similarity
- CAT API
- Segment Merging
- Cluster Monitoring
- Cross-cluster Replication
- Autoscaling
- Boosting Queries
- Function Score Query
- Match Phrase Query
- Synonyms Graph
- ILM
- Rollover Policies
- Data Tiers
- Vector Search
- Semantic Search
- Hybrid Search
- Snapshots & restore
- SLM
- Authentication
- Roles & Users
- API Keys
BM25 Algorithm: common questions
Can I learn BM25 Algorithm in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain BM25 Algorithm in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this BM25 Algorithm tutorial for beginners?
It is lesson 93 of 113 in the free Elasticsearch roadmap, in stage 7, Search Analyzer. If you are new to Elasticsearch, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.