mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-30 23:13:09 +08:00
vectorStore
stabilization
- `vectorStore` feature is always enabled - `vectorStore` can no longer be set in the `/experimental-features` PATCH route - `vectorStore` status is no longer returned in the `/experimental-features` GET route
This commit is contained in:
parent
e568dbbabb
commit
d78951feb7
@ -110,6 +110,7 @@ impl FeatureData {
|
|||||||
metrics: metrics || persisted_features.metrics,
|
metrics: metrics || persisted_features.metrics,
|
||||||
logs_route: logs_route || persisted_features.logs_route,
|
logs_route: logs_route || persisted_features.logs_route,
|
||||||
contains_filter: contains_filter || persisted_features.contains_filter,
|
contains_filter: contains_filter || persisted_features.contains_filter,
|
||||||
|
vector_store: true,
|
||||||
..persisted_features
|
..persisted_features
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
|
|||||||
security(("Bearer" = ["experimental_features.get", "experimental_features.*", "*"])),
|
security(("Bearer" = ["experimental_features.get", "experimental_features.*", "*"])),
|
||||||
responses(
|
responses(
|
||||||
(status = OK, description = "Experimental features are returned", body = RuntimeTogglableFeatures, content_type = "application/json", example = json!(RuntimeTogglableFeatures {
|
(status = OK, description = "Experimental features are returned", body = RuntimeTogglableFeatures, content_type = "application/json", example = json!(RuntimeTogglableFeatures {
|
||||||
vector_store: Some(true),
|
|
||||||
metrics: Some(true),
|
metrics: Some(true),
|
||||||
logs_route: Some(false),
|
logs_route: Some(false),
|
||||||
edit_documents_by_function: Some(false),
|
edit_documents_by_function: Some(false),
|
||||||
@ -71,6 +70,7 @@ async fn get_features(
|
|||||||
let features = index_scheduler.features();
|
let features = index_scheduler.features();
|
||||||
|
|
||||||
let features = features.runtime_features();
|
let features = features.runtime_features();
|
||||||
|
let features: RuntimeTogglableFeatures = features.into();
|
||||||
debug!(returns = ?features, "Get features");
|
debug!(returns = ?features, "Get features");
|
||||||
HttpResponse::Ok().json(features)
|
HttpResponse::Ok().json(features)
|
||||||
}
|
}
|
||||||
@ -80,8 +80,6 @@ async fn get_features(
|
|||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
#[schema(rename_all = "camelCase")]
|
#[schema(rename_all = "camelCase")]
|
||||||
pub struct RuntimeTogglableFeatures {
|
pub struct RuntimeTogglableFeatures {
|
||||||
#[deserr(default)]
|
|
||||||
pub vector_store: Option<bool>,
|
|
||||||
#[deserr(default)]
|
#[deserr(default)]
|
||||||
pub metrics: Option<bool>,
|
pub metrics: Option<bool>,
|
||||||
#[deserr(default)]
|
#[deserr(default)]
|
||||||
@ -92,6 +90,25 @@ pub struct RuntimeTogglableFeatures {
|
|||||||
pub contains_filter: Option<bool>,
|
pub contains_filter: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<meilisearch_types::features::RuntimeTogglableFeatures> 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)]
|
#[derive(Serialize)]
|
||||||
pub struct PatchExperimentalFeatureAnalytics {
|
pub struct PatchExperimentalFeatureAnalytics {
|
||||||
vector_store: bool,
|
vector_store: bool,
|
||||||
@ -161,7 +178,7 @@ async fn patch_features(
|
|||||||
|
|
||||||
let old_features = features.runtime_features();
|
let old_features = features.runtime_features();
|
||||||
let new_features = meilisearch_types::features::RuntimeTogglableFeatures {
|
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),
|
metrics: new_features.0.metrics.unwrap_or(old_features.metrics),
|
||||||
logs_route: new_features.0.logs_route.unwrap_or(old_features.logs_route),
|
logs_route: new_features.0.logs_route.unwrap_or(old_features.logs_route),
|
||||||
edit_documents_by_function: new_features
|
edit_documents_by_function: new_features
|
||||||
|
Loading…
x
Reference in New Issue
Block a user