use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "snake_case")]
pub struct Bm25Config {
pub title_weight: f64,
pub description_weight: f64,
pub headings_weight: f64,
pub body_weight: f64,
pub concept_type_weight: f64,
pub k1: f64,
pub b: f64,
}
impl Default for Bm25Config {
fn default() -> Self {
Self {
title_weight: 10.0,
description_weight: 5.0,
headings_weight: 2.0,
body_weight: 1.0,
concept_type_weight: 0.0,
k1: 1.2,
b: 0.75,
}
}
}