diff --git a/crates/index-scheduler/src/features.rs b/crates/index-scheduler/src/features.rs index f4ac80511..15a53ff17 100644 --- a/crates/index-scheduler/src/features.rs +++ b/crates/index-scheduler/src/features.rs @@ -110,6 +110,7 @@ impl FeatureData { metrics: metrics || persisted_features.metrics, logs_route: logs_route || persisted_features.logs_route, contains_filter: contains_filter || persisted_features.contains_filter, + vector_store: true, ..persisted_features })); diff --git a/crates/meilisearch/src/routes/features.rs b/crates/meilisearch/src/routes/features.rs index fe41ad9d9..5e57aa382 100644 --- a/crates/meilisearch/src/routes/features.rs +++ b/crates/meilisearch/src/routes/features.rs @@ -46,7 +46,6 @@ pub fn configure(cfg: &mut web::ServiceConfig) { security(("Bearer" = ["experimental_features.get", "experimental_features.*", "*"])), responses( (status = OK, description = "Experimental features are returned", body = RuntimeTogglableFeatures, content_type = "application/json", example = json!(RuntimeTogglableFeatures { - vector_store: Some(true), metrics: Some(true), logs_route: Some(false), edit_documents_by_function: Some(false), @@ -71,6 +70,7 @@ async fn get_features( let features = index_scheduler.features(); let features = features.runtime_features(); + let features: RuntimeTogglableFeatures = features.into(); debug!(returns = ?features, "Get features"); HttpResponse::Ok().json(features) } @@ -80,8 +80,6 @@ async fn get_features( #[serde(rename_all = "camelCase")] #[schema(rename_all = "camelCase")] pub struct RuntimeTogglableFeatures { - #[deserr(default)] - pub vector_store: Option, #[deserr(default)] pub metrics: Option, #[deserr(default)] @@ -92,6 +90,25 @@ pub struct RuntimeTogglableFeatures { pub contains_filter: Option, } +impl From for RuntimeTogglableFeatures { + fn from(value: meilisearch_types::features::RuntimeTogglableFeatures) -> Self { + let meilisearch_types::features::RuntimeTogglableFeatures { + vector_store: _, + metrics, + logs_route, + edit_documents_by_function, + contains_filter, + } = value; + + Self { + metrics: Some(metrics), + logs_route: Some(logs_route), + edit_documents_by_function: Some(edit_documents_by_function), + contains_filter: Some(contains_filter), + } + } +} + #[derive(Serialize)] pub struct PatchExperimentalFeatureAnalytics { vector_store: bool, @@ -161,7 +178,7 @@ async fn patch_features( let old_features = features.runtime_features(); let new_features = meilisearch_types::features::RuntimeTogglableFeatures { - vector_store: new_features.0.vector_store.unwrap_or(old_features.vector_store), + vector_store: true, metrics: new_features.0.metrics.unwrap_or(old_features.metrics), logs_route: new_features.0.logs_route.unwrap_or(old_features.logs_route), edit_documents_by_function: new_features