mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
Merge pull request #309 from bidoubiwa/remove_stop_words_from_settings
Removed stop words from settings route
This commit is contained in:
commit
e554784527
@ -1,4 +1,4 @@
|
|||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use http::StatusCode;
|
use http::StatusCode;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -14,7 +14,6 @@ use crate::Data;
|
|||||||
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
pub struct SettingBody {
|
pub struct SettingBody {
|
||||||
pub stop_words: Option<StopWords>,
|
|
||||||
pub ranking_order: Option<RankingOrder>,
|
pub ranking_order: Option<RankingOrder>,
|
||||||
pub distinct_field: Option<DistinctField>,
|
pub distinct_field: Option<DistinctField>,
|
||||||
pub ranking_rules: Option<RankingRules>,
|
pub ranking_rules: Option<RankingRules>,
|
||||||
@ -27,7 +26,6 @@ pub enum RankingOrdering {
|
|||||||
Dsc,
|
Dsc,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type StopWords = HashSet<String>;
|
|
||||||
pub type RankingOrder = Vec<String>;
|
pub type RankingOrder = Vec<String>;
|
||||||
pub type DistinctField = String;
|
pub type DistinctField = String;
|
||||||
pub type RankingRules = HashMap<String, RankingOrdering>;
|
pub type RankingRules = HashMap<String, RankingOrdering>;
|
||||||
@ -62,10 +60,6 @@ pub async fn update(mut ctx: Context<Data>) -> SResult<Response> {
|
|||||||
None => SettingBody::default(),
|
None => SettingBody::default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(stop_words) = settings.stop_words {
|
|
||||||
current_settings.stop_words = Some(stop_words);
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(ranking_order) = settings.ranking_order {
|
if let Some(ranking_order) = settings.ranking_order {
|
||||||
current_settings.ranking_order = Some(ranking_order);
|
current_settings.ranking_order = Some(ranking_order);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user