mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
cleanup movies dataset and related functions
This commit is contained in:
parent
979b01a1c0
commit
3d73a4895e
File diff suppressed because it is too large
Load Diff
@ -476,59 +476,4 @@ impl Server {
|
||||
pub async fn get_sys_info_pretty(&mut self) -> (Value, StatusCode) {
|
||||
self.get_request("/sys-info/pretty").await
|
||||
}
|
||||
|
||||
// Populate routes
|
||||
|
||||
pub async fn populate_movies(&mut self) {
|
||||
let body = json!({
|
||||
"uid": "movies",
|
||||
"primaryKey": "id",
|
||||
});
|
||||
self.create_index(body).await;
|
||||
|
||||
let body = json!({
|
||||
"rankingRules": [
|
||||
"typo",
|
||||
"words",
|
||||
"proximity",
|
||||
"attribute",
|
||||
"wordsPosition",
|
||||
"desc(popularity)",
|
||||
"exactness",
|
||||
"desc(vote_average)",
|
||||
],
|
||||
"searchableAttributes": [
|
||||
"title",
|
||||
"tagline",
|
||||
"overview",
|
||||
"cast",
|
||||
"director",
|
||||
"producer",
|
||||
"production_companies",
|
||||
"genres",
|
||||
],
|
||||
"displayedAttributes": [
|
||||
"title",
|
||||
"director",
|
||||
"producer",
|
||||
"tagline",
|
||||
"genres",
|
||||
"id",
|
||||
"overview",
|
||||
"vote_count",
|
||||
"vote_average",
|
||||
"poster_path",
|
||||
"popularity",
|
||||
],
|
||||
"acceptNewFields": false,
|
||||
});
|
||||
|
||||
self.update_all_settings(body).await;
|
||||
|
||||
let dataset = include_bytes!("assets/movies.json");
|
||||
|
||||
let body: Value = serde_json::from_slice(dataset).unwrap();
|
||||
|
||||
self.add_or_replace_multiple_documents(body).await;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user