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

View File

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

View File

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

View File

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

View File

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

View File

@ -178,7 +178,7 @@ pub struct 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 ret = V6IndexReader {