mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
Remove proximityPrecision form the experimental feature
This commit is contained in:
parent
e0f712b9d3
commit
35e1981488
@ -1345,9 +1345,6 @@ impl IndexScheduler {
|
|||||||
|
|
||||||
for (task, (_, settings)) in tasks.iter_mut().zip(settings) {
|
for (task, (_, settings)) in tasks.iter_mut().zip(settings) {
|
||||||
let checked_settings = settings.clone().check();
|
let checked_settings = settings.clone().check();
|
||||||
if checked_settings.proximity_precision.set().is_some() {
|
|
||||||
self.features.features().check_proximity_precision()?;
|
|
||||||
}
|
|
||||||
task.details = Some(Details::SettingsUpdate { settings: Box::new(settings) });
|
task.details = Some(Details::SettingsUpdate { settings: Box::new(settings) });
|
||||||
apply_settings_to_builder(&checked_settings, &mut builder);
|
apply_settings_to_builder(&checked_settings, &mut builder);
|
||||||
|
|
||||||
|
@ -81,19 +81,6 @@ impl RoFeatures {
|
|||||||
.into())
|
.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_proximity_precision(&self) -> Result<()> {
|
|
||||||
if self.runtime.proximity_precision {
|
|
||||||
Ok(())
|
|
||||||
} else {
|
|
||||||
Err(FeatureNotEnabledError {
|
|
||||||
disabled_action: "Using `proximityPrecision` index setting",
|
|
||||||
feature: "proximity precision",
|
|
||||||
issue_link: "https://github.com/orgs/meilisearch/discussions/710",
|
|
||||||
}
|
|
||||||
.into())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FeatureData {
|
impl FeatureData {
|
||||||
|
@ -7,7 +7,6 @@ pub struct RuntimeTogglableFeatures {
|
|||||||
pub vector_store: bool,
|
pub vector_store: bool,
|
||||||
pub metrics: bool,
|
pub metrics: bool,
|
||||||
pub export_puffin_reports: bool,
|
pub export_puffin_reports: bool,
|
||||||
pub proximity_precision: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, Clone, Copy)]
|
#[derive(Default, Debug, Clone, Copy)]
|
||||||
|
@ -48,8 +48,6 @@ pub struct RuntimeTogglableFeatures {
|
|||||||
pub metrics: Option<bool>,
|
pub metrics: Option<bool>,
|
||||||
#[deserr(default)]
|
#[deserr(default)]
|
||||||
pub export_puffin_reports: Option<bool>,
|
pub export_puffin_reports: Option<bool>,
|
||||||
#[deserr(default)]
|
|
||||||
pub proximity_precision: Option<bool>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn patch_features(
|
async fn patch_features(
|
||||||
@ -72,10 +70,6 @@ async fn patch_features(
|
|||||||
.0
|
.0
|
||||||
.export_puffin_reports
|
.export_puffin_reports
|
||||||
.unwrap_or(old_features.export_puffin_reports),
|
.unwrap_or(old_features.export_puffin_reports),
|
||||||
proximity_precision: new_features
|
|
||||||
.0
|
|
||||||
.proximity_precision
|
|
||||||
.unwrap_or(old_features.proximity_precision),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// explicitly destructure for analytics rather than using the `Serialize` implementation, because
|
// explicitly destructure for analytics rather than using the `Serialize` implementation, because
|
||||||
@ -86,7 +80,6 @@ async fn patch_features(
|
|||||||
vector_store,
|
vector_store,
|
||||||
metrics,
|
metrics,
|
||||||
export_puffin_reports,
|
export_puffin_reports,
|
||||||
proximity_precision,
|
|
||||||
} = new_features;
|
} = new_features;
|
||||||
|
|
||||||
analytics.publish(
|
analytics.publish(
|
||||||
@ -96,7 +89,6 @@ async fn patch_features(
|
|||||||
"vector_store": vector_store,
|
"vector_store": vector_store,
|
||||||
"metrics": metrics,
|
"metrics": metrics,
|
||||||
"export_puffin_reports": export_puffin_reports,
|
"export_puffin_reports": export_puffin_reports,
|
||||||
"proximity_precision": proximity_precision,
|
|
||||||
}),
|
}),
|
||||||
Some(&req),
|
Some(&req),
|
||||||
);
|
);
|
||||||
|
@ -1848,8 +1848,7 @@ async fn import_dump_v6_containing_experimental_features() {
|
|||||||
"scoreDetails": false,
|
"scoreDetails": false,
|
||||||
"vectorStore": false,
|
"vectorStore": false,
|
||||||
"metrics": false,
|
"metrics": false,
|
||||||
"exportPuffinReports": false,
|
"exportPuffinReports": false
|
||||||
"proximityPrecision": false
|
|
||||||
}
|
}
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
|
@ -21,8 +21,7 @@ async fn experimental_features() {
|
|||||||
"scoreDetails": false,
|
"scoreDetails": false,
|
||||||
"vectorStore": false,
|
"vectorStore": false,
|
||||||
"metrics": false,
|
"metrics": false,
|
||||||
"exportPuffinReports": false,
|
"exportPuffinReports": false
|
||||||
"proximityPrecision": false
|
|
||||||
}
|
}
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
@ -34,8 +33,7 @@ async fn experimental_features() {
|
|||||||
"scoreDetails": false,
|
"scoreDetails": false,
|
||||||
"vectorStore": true,
|
"vectorStore": true,
|
||||||
"metrics": false,
|
"metrics": false,
|
||||||
"exportPuffinReports": false,
|
"exportPuffinReports": false
|
||||||
"proximityPrecision": false
|
|
||||||
}
|
}
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
@ -47,8 +45,7 @@ async fn experimental_features() {
|
|||||||
"scoreDetails": false,
|
"scoreDetails": false,
|
||||||
"vectorStore": true,
|
"vectorStore": true,
|
||||||
"metrics": false,
|
"metrics": false,
|
||||||
"exportPuffinReports": false,
|
"exportPuffinReports": false
|
||||||
"proximityPrecision": false
|
|
||||||
}
|
}
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
@ -61,8 +58,7 @@ async fn experimental_features() {
|
|||||||
"scoreDetails": false,
|
"scoreDetails": false,
|
||||||
"vectorStore": true,
|
"vectorStore": true,
|
||||||
"metrics": false,
|
"metrics": false,
|
||||||
"exportPuffinReports": false,
|
"exportPuffinReports": false
|
||||||
"proximityPrecision": false
|
|
||||||
}
|
}
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
@ -75,8 +71,7 @@ async fn experimental_features() {
|
|||||||
"scoreDetails": false,
|
"scoreDetails": false,
|
||||||
"vectorStore": true,
|
"vectorStore": true,
|
||||||
"metrics": false,
|
"metrics": false,
|
||||||
"exportPuffinReports": false,
|
"exportPuffinReports": false
|
||||||
"proximityPrecision": false
|
|
||||||
}
|
}
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
@ -96,8 +91,7 @@ async fn experimental_feature_metrics() {
|
|||||||
"scoreDetails": false,
|
"scoreDetails": false,
|
||||||
"vectorStore": false,
|
"vectorStore": false,
|
||||||
"metrics": true,
|
"metrics": true,
|
||||||
"exportPuffinReports": false,
|
"exportPuffinReports": false
|
||||||
"proximityPrecision": false
|
|
||||||
}
|
}
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
@ -152,7 +146,7 @@ async fn errors() {
|
|||||||
meili_snap::snapshot!(code, @"400 Bad Request");
|
meili_snap::snapshot!(code, @"400 Bad Request");
|
||||||
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
|
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
|
||||||
{
|
{
|
||||||
"message": "Unknown field `NotAFeature`: expected one of `scoreDetails`, `vectorStore`, `metrics`, `exportPuffinReports`, `proximityPrecision`",
|
"message": "Unknown field `NotAFeature`: expected one of `scoreDetails`, `vectorStore`, `metrics`, `exportPuffinReports`",
|
||||||
"code": "bad_request",
|
"code": "bad_request",
|
||||||
"type": "invalid_request",
|
"type": "invalid_request",
|
||||||
"link": "https://docs.meilisearch.com/errors#bad_request"
|
"link": "https://docs.meilisearch.com/errors#bad_request"
|
||||||
|
@ -27,17 +27,6 @@ static DOCUMENTS: Lazy<crate::common::Value> = Lazy::new(|| {
|
|||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn attribute_scale_search() {
|
async fn attribute_scale_search() {
|
||||||
let server = Server::new().await;
|
let server = Server::new().await;
|
||||||
let (response, code) = server.set_features(json!({"proximityPrecision": true})).await;
|
|
||||||
meili_snap::snapshot!(code, @"200 OK");
|
|
||||||
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
|
|
||||||
{
|
|
||||||
"scoreDetails": false,
|
|
||||||
"vectorStore": false,
|
|
||||||
"metrics": false,
|
|
||||||
"exportPuffinReports": false,
|
|
||||||
"proximityPrecision": true
|
|
||||||
}
|
|
||||||
"###);
|
|
||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
|
|
||||||
index.add_documents(DOCUMENTS.clone(), None).await;
|
index.add_documents(DOCUMENTS.clone(), None).await;
|
||||||
@ -111,17 +100,6 @@ async fn attribute_scale_search() {
|
|||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn attribute_scale_phrase_search() {
|
async fn attribute_scale_phrase_search() {
|
||||||
let server = Server::new().await;
|
let server = Server::new().await;
|
||||||
let (response, code) = server.set_features(json!({"proximityPrecision": true})).await;
|
|
||||||
meili_snap::snapshot!(code, @"200 OK");
|
|
||||||
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
|
|
||||||
{
|
|
||||||
"scoreDetails": false,
|
|
||||||
"vectorStore": false,
|
|
||||||
"metrics": false,
|
|
||||||
"exportPuffinReports": false,
|
|
||||||
"proximityPrecision": true
|
|
||||||
}
|
|
||||||
"###);
|
|
||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
|
|
||||||
index.add_documents(DOCUMENTS.clone(), None).await;
|
index.add_documents(DOCUMENTS.clone(), None).await;
|
||||||
@ -190,17 +168,6 @@ async fn attribute_scale_phrase_search() {
|
|||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn word_scale_set_and_reset() {
|
async fn word_scale_set_and_reset() {
|
||||||
let server = Server::new().await;
|
let server = Server::new().await;
|
||||||
let (response, code) = server.set_features(json!({"proximityPrecision": true})).await;
|
|
||||||
meili_snap::snapshot!(code, @"200 OK");
|
|
||||||
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
|
|
||||||
{
|
|
||||||
"scoreDetails": false,
|
|
||||||
"vectorStore": false,
|
|
||||||
"metrics": false,
|
|
||||||
"exportPuffinReports": false,
|
|
||||||
"proximityPrecision": true
|
|
||||||
}
|
|
||||||
"###);
|
|
||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
|
|
||||||
index.add_documents(DOCUMENTS.clone(), None).await;
|
index.add_documents(DOCUMENTS.clone(), None).await;
|
||||||
@ -316,17 +283,6 @@ async fn word_scale_set_and_reset() {
|
|||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn attribute_scale_default_ranking_rules() {
|
async fn attribute_scale_default_ranking_rules() {
|
||||||
let server = Server::new().await;
|
let server = Server::new().await;
|
||||||
let (response, code) = server.set_features(json!({"proximityPrecision": true})).await;
|
|
||||||
meili_snap::snapshot!(code, @"200 OK");
|
|
||||||
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
|
|
||||||
{
|
|
||||||
"scoreDetails": false,
|
|
||||||
"vectorStore": false,
|
|
||||||
"metrics": false,
|
|
||||||
"exportPuffinReports": false,
|
|
||||||
"proximityPrecision": true
|
|
||||||
}
|
|
||||||
"###);
|
|
||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
|
|
||||||
index.add_documents(DOCUMENTS.clone(), None).await;
|
index.add_documents(DOCUMENTS.clone(), None).await;
|
||||||
|
Loading…
Reference in New Issue
Block a user