bm25_score
Compute BM25 relevance score between a query and one or more documents. BM25 is the industry-standard keyword-based ranking algorithm used in Elasticsearch, OpenSearch, and Weaviate hybrid search. Returns ranked results with normalized scores.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "refund damaged",
"documents": [
"shipping times",
"refund for damaged items",
"office hours"
]
},
"name": "bm25_score"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| b | No | Length normalization factor (default: 0.75) | |
| k1 | No | Term frequency saturation (default: 1.5) | |
| query | Yes | The search query | |
| top_k | No | Return top K results (default: all) | |
| documents | Yes | Array of documents to rank |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| b | No | ||
| k1 | No | ||
| index | No | ||
| query | No | ||
| results | No | ||
| bm25_score | No | ||
| doc_length | No | ||
| doc_preview | No | ||
| avg_doc_length | No | ||
| documents_count | No |