fix some warnings

This commit is contained in:
Tamo 2022-10-09 17:30:34 +02:00 committed by Clément Renault
parent 58ef80a2a7
commit 6f327a00c7
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
7 changed files with 130 additions and 30 deletions

View File

@ -117,7 +117,10 @@ pub(crate) mod test {
uid: 0, uid: 0,
index_uid: Some(S("doggos")), index_uid: Some(S("doggos")),
status: Status::Succeeded, status: Status::Succeeded,
kind: Kind::DocumentAddition, kind: Kind::DocumentImport {
method: index::milli::update::IndexDocumentsMethod::UpdateDocuments,
allow_index_creation: true,
},
details: Some(Details::DocumentAddition { details: Some(Details::DocumentAddition {
received_documents: 10_000, received_documents: 10_000,
indexed_documents: 3, indexed_documents: 3,
@ -135,7 +138,10 @@ pub(crate) mod test {
uid: 1, uid: 1,
index_uid: Some(S("doggos")), index_uid: Some(S("doggos")),
status: Status::Enqueued, status: Status::Enqueued,
kind: Kind::DocumentAddition, kind: Kind::DocumentImport {
method: index::milli::update::IndexDocumentsMethod::UpdateDocuments,
allow_index_creation: true,
},
details: None, details: None,
error: None, error: None,
duration: Some(Duration::DAY), duration: Some(Duration::DAY),

View File

@ -18,7 +18,12 @@ expression: tasks
"uid": 20, "uid": 20,
"indexUid": "movies_2", "indexUid": "movies_2",
"status": "enqueued", "status": "enqueued",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 200, "receivedDocuments": 200,
"indexedDocuments": 0 "indexedDocuments": 0
@ -29,7 +34,12 @@ expression: tasks
"uid": 19, "uid": 19,
"indexUid": "movies", "indexUid": "movies",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 100, "receivedDocuments": 100,
"indexedDocuments": 100 "indexedDocuments": 100
@ -43,7 +53,12 @@ expression: tasks
"uid": 18, "uid": 18,
"indexUid": "dnd_spells", "indexUid": "dnd_spells",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 10, "receivedDocuments": 10,
"indexedDocuments": 10 "indexedDocuments": 10
@ -57,7 +72,12 @@ expression: tasks
"uid": 17, "uid": 17,
"indexUid": "dnd_spells", "indexUid": "dnd_spells",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 10, "receivedDocuments": 10,
"indexedDocuments": 10 "indexedDocuments": 10
@ -71,7 +91,12 @@ expression: tasks
"uid": 16, "uid": 16,
"indexUid": "products", "indexUid": "products",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 10, "receivedDocuments": 10,
"indexedDocuments": 10 "indexedDocuments": 10
@ -85,7 +110,12 @@ expression: tasks
"uid": 15, "uid": 15,
"indexUid": "products", "indexUid": "products",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 10, "receivedDocuments": 10,
"indexedDocuments": 10 "indexedDocuments": 10
@ -99,7 +129,11 @@ expression: tasks
"uid": 14, "uid": 14,
"indexUid": "products", "indexUid": "products",
"status": "succeeded", "status": "succeeded",
"type": "settings", "type": {
"settings": {
"allow_index_creation": true
}
},
"details": { "details": {
"synonyms": { "synonyms": {
"android": [ "android": [
@ -126,7 +160,11 @@ expression: tasks
"uid": 13, "uid": 13,
"indexUid": "movies", "indexUid": "movies",
"status": "succeeded", "status": "succeeded",
"type": "settings", "type": {
"settings": {
"allow_index_creation": true
}
},
"details": { "details": {
"rankingRules": [ "rankingRules": [
"words", "words",
@ -147,7 +185,11 @@ expression: tasks
"uid": 12, "uid": 12,
"indexUid": "movies", "indexUid": "movies",
"status": "succeeded", "status": "succeeded",
"type": "settings", "type": {
"settings": {
"allow_index_creation": true
}
},
"details": { "details": {
"filterableAttributes": [ "filterableAttributes": [
"genres", "genres",
@ -166,7 +208,12 @@ expression: tasks
"uid": 11, "uid": 11,
"indexUid": "movies", "indexUid": "movies",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 10, "receivedDocuments": 10,
"indexedDocuments": 10 "indexedDocuments": 10
@ -180,7 +227,12 @@ expression: tasks
"uid": 10, "uid": 10,
"indexUid": "movies", "indexUid": "movies",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 100, "receivedDocuments": 100,
"indexedDocuments": 100 "indexedDocuments": 100
@ -194,7 +246,12 @@ expression: tasks
"uid": 9, "uid": 9,
"indexUid": "movies", "indexUid": "movies",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 90, "receivedDocuments": 90,
"indexedDocuments": 90 "indexedDocuments": 90
@ -221,7 +278,12 @@ expression: tasks
"uid": 7, "uid": 7,
"indexUid": "dnd_spells", "indexUid": "dnd_spells",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 10, "receivedDocuments": 10,
"indexedDocuments": 10 "indexedDocuments": 10
@ -235,7 +297,12 @@ expression: tasks
"uid": 6, "uid": 6,
"indexUid": "dnd_spells", "indexUid": "dnd_spells",
"status": "failed", "status": "failed",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 10, "receivedDocuments": 10,
"indexedDocuments": 0 "indexedDocuments": 0
@ -255,7 +322,12 @@ expression: tasks
"uid": 5, "uid": 5,
"indexUid": "products", "indexUid": "products",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 10, "receivedDocuments": 10,
"indexedDocuments": 10 "indexedDocuments": 10
@ -269,7 +341,12 @@ expression: tasks
"uid": 4, "uid": 4,
"indexUid": "products", "indexUid": "products",
"status": "failed", "status": "failed",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 10, "receivedDocuments": 10,
"indexedDocuments": 0 "indexedDocuments": 0
@ -289,7 +366,11 @@ expression: tasks
"uid": 3, "uid": 3,
"indexUid": "products", "indexUid": "products",
"status": "succeeded", "status": "succeeded",
"type": "settings", "type": {
"settings": {
"allow_index_creation": true
}
},
"details": { "details": {
"synonyms": { "synonyms": {
"android": [ "android": [
@ -316,7 +397,11 @@ expression: tasks
"uid": 2, "uid": 2,
"indexUid": "movies", "indexUid": "movies",
"status": "succeeded", "status": "succeeded",
"type": "settings", "type": {
"settings": {
"allow_index_creation": true
}
},
"details": { "details": {
"rankingRules": [ "rankingRules": [
"words", "words",
@ -337,7 +422,11 @@ expression: tasks
"uid": 1, "uid": 1,
"indexUid": "movies", "indexUid": "movies",
"status": "succeeded", "status": "succeeded",
"type": "settings", "type": {
"settings": {
"allow_index_creation": true
}
},
"details": { "details": {
"filterableAttributes": [ "filterableAttributes": [
"genres", "genres",
@ -356,7 +445,12 @@ expression: tasks
"uid": 0, "uid": 0,
"indexUid": "movies", "indexUid": "movies",
"status": "succeeded", "status": "succeeded",
"type": "documentAddition", "type": {
"documentImport": {
"method": "ReplaceDocuments",
"allow_index_creation": true
}
},
"details": { "details": {
"receivedDocuments": 10, "receivedDocuments": 10,
"indexedDocuments": 10 "indexedDocuments": 10

View File

@ -1,6 +1,6 @@
use std::fs::File;
use uuid::Uuid;
use crate::reader::{v3, v4, DumpReader, IndexReader}; use crate::reader::{v3, v4, DumpReader, IndexReader};
use crate::Result; use crate::Result;
@ -327,7 +327,7 @@ pub(crate) mod test {
let mut products = indexes.pop().unwrap(); let mut products = indexes.pop().unwrap();
let mut movies2 = indexes.pop().unwrap(); let mut movies2 = indexes.pop().unwrap();
let mut movies = indexes.pop().unwrap(); let movies = indexes.pop().unwrap();
let mut spells = indexes.pop().unwrap(); let mut spells = indexes.pop().unwrap();
assert!(indexes.is_empty()); assert!(indexes.is_empty());

View File

@ -1,4 +1,4 @@
use std::fs::File;
use crate::reader::{v4, v5, DumpReader, IndexReader}; use crate::reader::{v4, v5, DumpReader, IndexReader};
use crate::Result; use crate::Result;

View File

@ -2,8 +2,8 @@ use std::io::Read;
use std::{fs::File, io::BufReader}; use std::{fs::File, io::BufReader};
use flate2::bufread::GzDecoder; use flate2::bufread::GzDecoder;
use index_scheduler::TaskView;
use meilisearch_auth::Key;
use serde::Deserialize; use serde::Deserialize;
use tempfile::TempDir; use tempfile::TempDir;

View File

@ -31,7 +31,7 @@ use std::{
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use tempfile::TempDir; use tempfile::TempDir;
use time::OffsetDateTime; use time::OffsetDateTime;
use uuid::Uuid;
pub mod errors; pub mod errors;
pub mod meta; pub mod meta;

View File

@ -178,7 +178,7 @@ pub struct V6IndexReader {
} }
impl V6IndexReader { impl V6IndexReader {
pub fn new(name: String, path: &Path) -> Result<Self> { pub fn new(_name: String, path: &Path) -> Result<Self> {
let metadata = File::open(path.join("metadata.json"))?; let metadata = File::open(path.join("metadata.json"))?;
let ret = V6IndexReader { let ret = V6IndexReader {