rename the search_cutoff parameter to search_cutoff_ms

This commit is contained in:
Tamo 2024-03-18 12:06:00 +01:00
parent 038c26c118
commit 6a0c399c2f
8 changed files with 39 additions and 38 deletions

View file

@ -16,6 +16,7 @@ pub use server::{default_settings, Server};
pub struct Value(pub serde_json::Value);
impl Value {
#[track_caller]
pub fn uid(&self) -> u64 {
if let Some(uid) = self["uid"].as_u64() {
uid

View file

@ -78,7 +78,7 @@ async fn import_dump_v1_movie_raw() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -240,7 +240,7 @@ async fn import_dump_v1_movie_with_settings() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -388,7 +388,7 @@ async fn import_dump_v1_rubygems_with_settings() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -522,7 +522,7 @@ async fn import_dump_v2_movie_raw() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -668,7 +668,7 @@ async fn import_dump_v2_movie_with_settings() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -813,7 +813,7 @@ async fn import_dump_v2_rubygems_with_settings() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -947,7 +947,7 @@ async fn import_dump_v3_movie_raw() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -1093,7 +1093,7 @@ async fn import_dump_v3_movie_with_settings() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -1238,7 +1238,7 @@ async fn import_dump_v3_rubygems_with_settings() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -1372,7 +1372,7 @@ async fn import_dump_v4_movie_raw() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -1518,7 +1518,7 @@ async fn import_dump_v4_movie_with_settings() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -1663,7 +1663,7 @@ async fn import_dump_v4_rubygems_with_settings() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###
);
@ -1908,7 +1908,7 @@ async fn import_dump_v6_containing_experimental_features() {
"pagination": {
"maxTotalHits": 1000
},
"searchCutoff": null
"searchCutoffMs": null
}
"###);

View file

@ -843,7 +843,7 @@ async fn test_degraded_score_details() {
index.add_documents(json!(documents), None).await;
// We can't really use anything else than 0ms here; otherwise, the test will get flaky.
let (res, _code) = index.update_settings(json!({ "searchCutoff": 0 })).await;
let (res, _code) = index.update_settings(json!({ "searchCutoffMs": 0 })).await;
index.wait_task(res.uid()).await;
index
@ -855,7 +855,7 @@ async fn test_degraded_score_details() {
}),
|response, code| {
meili_snap::snapshot!(code, @"200 OK");
meili_snap::snapshot!(meili_snap::json_string!(response), @r###"
meili_snap::snapshot!(meili_snap::json_string!(response, { ".processingTimeMs" => "[duration]" }), @r###"
{
"hits": [
{
@ -905,7 +905,7 @@ async fn test_degraded_score_details() {
}
],
"query": "b",
"processingTimeMs": 0,
"processingTimeMs": "[duration]",
"limit": 20,
"offset": 0,
"estimatedTotalHits": 3

View file

@ -35,7 +35,7 @@ static DEFAULT_SETTINGS_VALUES: Lazy<HashMap<&'static str, Value>> = Lazy::new(|
"maxTotalHits": json!(1000),
}),
);
map.insert("search_cutoff", json!(null));
map.insert("search_cutoff_ms", json!(null));
map
});
@ -85,7 +85,7 @@ async fn get_settings() {
})
);
assert_eq!(settings["proximityPrecision"], json!("byWord"));
assert_eq!(settings["searchCutoff"], json!(null));
assert_eq!(settings["searchCutoffMs"], json!(null));
}
#[actix_rt::test]
@ -288,7 +288,7 @@ test_setting_routes!(
synonyms put,
pagination patch,
faceting patch,
search_cutoff put
search_cutoff_ms put
);
#[actix_rt::test]