use crate::store::{IndexConfig, IndexParams, IndexType};
impl IndexConfig {
pub fn vector(column: impl Into<String>) -> Self {
Self {
columns: vec![column.into()],
index_type: IndexType::IvfHnswSq,
params: IndexParams::default(),
replace: true,
}
}
pub fn bm25(columns: Vec<String>) -> Self {
Self {
columns,
index_type: IndexType::Bm25,
params: IndexParams::default(),
replace: true,
}
}
pub fn btree(column: impl Into<String>) -> Self {
Self {
columns: vec![column.into()],
index_type: IndexType::BTree,
params: IndexParams::default(),
replace: true,
}
}
pub fn bitmap(column: impl Into<String>) -> Self {
Self {
columns: vec![column.into()],
index_type: IndexType::Bitmap,
params: IndexParams::default(),
replace: true,
}
}
pub fn with_type(mut self, index_type: IndexType) -> Self {
self.index_type = index_type;
self
}
pub fn with_params(mut self, params: IndexParams) -> Self {
self.params = params;
self
}
pub fn with_replace(mut self, replace: bool) -> Self {
self.replace = replace;
self
}
}