cleanup movies dataset and related functions

This commit is contained in:
Balaji Sivaraman 2020-06-27 18:41:45 +05:30
parent 979b01a1c0
commit 3d73a4895e
2 changed files with 0 additions and 100073 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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;
}
}