mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
update the settings routes
This commit is contained in:
parent
96cffeab1e
commit
79c63049d7
@ -43,6 +43,9 @@ pub struct Settings {
|
|||||||
skip_serializing_if = "Option::is_none"
|
skip_serializing_if = "Option::is_none"
|
||||||
)]
|
)]
|
||||||
pub ranking_rules: Option<Option<Vec<String>>>,
|
pub ranking_rules: Option<Option<Vec<String>>>,
|
||||||
|
|
||||||
|
// TODO we are missing the stopWords, synonyms and distinctAttribute for the GET settings
|
||||||
|
// request
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Settings {
|
impl Settings {
|
||||||
|
@ -131,7 +131,9 @@ async fn update_all(
|
|||||||
.update_settings(index_uid.into_inner(), body.into_inner(), true)
|
.update_settings(index_uid.into_inner(), body.into_inner(), true)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(update_result) => Ok(HttpResponse::Accepted().json(update_result)),
|
Ok(update_result) => {
|
||||||
|
Ok(HttpResponse::Accepted().json(serde_json::json!({ "updateId": update_result.id() })))
|
||||||
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
Ok(HttpResponse::BadRequest().json(serde_json::json!({ "error": e.to_string() })))
|
Ok(HttpResponse::BadRequest().json(serde_json::json!({ "error": e.to_string() })))
|
||||||
}
|
}
|
||||||
@ -161,7 +163,9 @@ async fn delete_all(
|
|||||||
.update_settings(index_uid.into_inner(), settings, false)
|
.update_settings(index_uid.into_inner(), settings, false)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(update_result) => Ok(HttpResponse::Accepted().json(update_result)),
|
Ok(update_result) => {
|
||||||
|
Ok(HttpResponse::Accepted().json(serde_json::json!({ "updateId": update_result.id() })))
|
||||||
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
Ok(HttpResponse::BadRequest().json(serde_json::json!({ "error": e.to_string() })))
|
Ok(HttpResponse::BadRequest().json(serde_json::json!({ "error": e.to_string() })))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user