mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-19 01:18:31 +08:00
Clean up many warning messages
This commit is contained in:
parent
0a5ad4db06
commit
6534a9ec1d
@ -353,7 +353,7 @@ mod tests {
|
|||||||
pub struct TempDatabase {
|
pub struct TempDatabase {
|
||||||
database: Database,
|
database: Database,
|
||||||
index: Index,
|
index: Index,
|
||||||
tempdir: TempDir,
|
_tempdir: TempDir,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TempDatabase {
|
impl TempDatabase {
|
||||||
@ -418,7 +418,7 @@ mod tests {
|
|||||||
writer.commit().unwrap();
|
writer.commit().unwrap();
|
||||||
drop(rkv);
|
drop(rkv);
|
||||||
|
|
||||||
TempDatabase { database, index, tempdir }
|
TempDatabase { database, index, _tempdir: tempdir }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,21 +94,20 @@ impl DocumentsFields {
|
|||||||
&self,
|
&self,
|
||||||
reader: &'r T,
|
reader: &'r T,
|
||||||
document_id: DocumentId,
|
document_id: DocumentId,
|
||||||
) -> Result<DocumentFieldsIter<'r, T>, rkv::StoreError>
|
) -> Result<DocumentFieldsIter<'r>, rkv::StoreError>
|
||||||
{
|
{
|
||||||
let document_id_bytes = document_id.0.to_be_bytes();
|
let document_id_bytes = document_id.0.to_be_bytes();
|
||||||
let iter = self.documents_fields.iter_from(reader, document_id_bytes)?;
|
let iter = self.documents_fields.iter_from(reader, document_id_bytes)?;
|
||||||
Ok(DocumentFieldsIter { reader, document_id, iter })
|
Ok(DocumentFieldsIter { document_id, iter })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct DocumentFieldsIter<'r, T> {
|
pub struct DocumentFieldsIter<'r> {
|
||||||
reader: &'r T,
|
|
||||||
document_id: DocumentId,
|
document_id: DocumentId,
|
||||||
iter: rkv::store::single::Iter<'r>,
|
iter: rkv::store::single::Iter<'r>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'r, T: rkv::Readable + 'r> Iterator for DocumentFieldsIter<'r, T> {
|
impl<'r> Iterator for DocumentFieldsIter<'r> {
|
||||||
type Item = Result<(SchemaAttr, &'r [u8]), rkv::StoreError>;
|
type Item = Result<(SchemaAttr, &'r [u8]), rkv::StoreError>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
use fst::{SetBuilder, set::OpBuilder};
|
use fst::{SetBuilder, set::OpBuilder};
|
||||||
use meilidb_schema::Schema;
|
|
||||||
use sdset::{SetOperation, duo::Union};
|
use sdset::{SetOperation, duo::Union};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
@ -76,7 +75,7 @@ pub fn push_documents_addition<D: serde::Serialize>(
|
|||||||
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
|
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
|
||||||
|
|
||||||
let update = Update::DocumentsAddition(values);
|
let update = Update::DocumentsAddition(values);
|
||||||
let update_id = updates_store.put_update(writer, last_update_id, &update)?;
|
updates_store.put_update(writer, last_update_id, &update)?;
|
||||||
|
|
||||||
Ok(last_update_id)
|
Ok(last_update_id)
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ pub fn push_documents_deletion(
|
|||||||
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
|
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
|
||||||
|
|
||||||
let update = Update::DocumentsDeletion(deletion);
|
let update = Update::DocumentsDeletion(deletion);
|
||||||
let update_id = updates_store.put_update(writer, last_update_id, &update)?;
|
updates_store.put_update(writer, last_update_id, &update)?;
|
||||||
|
|
||||||
Ok(last_update_id)
|
Ok(last_update_id)
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,7 @@ use std::cmp;
|
|||||||
use log::debug;
|
use log::debug;
|
||||||
use serde::{Serialize, Deserialize};
|
use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
use crate::{store, Error, MResult, DocumentId, RankedMap};
|
use crate::{store, MResult, DocumentId, RankedMap};
|
||||||
use crate::error::UnsupportedOperation;
|
|
||||||
use meilidb_schema::Schema;
|
use meilidb_schema::Schema;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
@ -25,7 +25,7 @@ pub fn push_schema_update(
|
|||||||
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
|
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
|
||||||
|
|
||||||
let update = Update::SchemaUpdate(schema);
|
let update = Update::SchemaUpdate(schema);
|
||||||
let update_id = updates_store.put_update(writer, last_update_id, &update)?;
|
updates_store.put_update(writer, last_update_id, &update)?;
|
||||||
|
|
||||||
Ok(last_update_id)
|
Ok(last_update_id)
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
use fst::{SetBuilder, set::OpBuilder};
|
use fst::{SetBuilder, set::OpBuilder};
|
||||||
use sdset::SetBuf;
|
use sdset::SetBuf;
|
||||||
|
|
||||||
use crate::automaton::normalize_str;
|
use crate::automaton::normalize_str;
|
||||||
use crate::raw_indexer::RawIndexer;
|
|
||||||
use crate::serde::{extract_document_id, Serializer, RamDocumentStore};
|
|
||||||
use crate::store;
|
|
||||||
use crate::update::{Update, next_update_id};
|
use crate::update::{Update, next_update_id};
|
||||||
use crate::{MResult, Error, RankedMap};
|
use crate::{store, MResult};
|
||||||
|
|
||||||
pub struct SynonymsAddition {
|
pub struct SynonymsAddition {
|
||||||
updates_store: store::Updates,
|
updates_store: store::Updates,
|
||||||
@ -67,7 +63,7 @@ pub fn push_synonyms_addition(
|
|||||||
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
|
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
|
||||||
|
|
||||||
let update = Update::SynonymsAddition(addition);
|
let update = Update::SynonymsAddition(addition);
|
||||||
let update_id = updates_store.put_update(writer, last_update_id, &update)?;
|
updates_store.put_update(writer, last_update_id, &update)?;
|
||||||
|
|
||||||
Ok(last_update_id)
|
Ok(last_update_id)
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,12 @@
|
|||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::iter::FromIterator;
|
use std::iter::FromIterator;
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
use fst::{SetBuilder, set::OpBuilder};
|
use fst::{SetBuilder, set::OpBuilder};
|
||||||
use sdset::SetBuf;
|
use sdset::SetBuf;
|
||||||
|
|
||||||
use crate::automaton::normalize_str;
|
use crate::automaton::normalize_str;
|
||||||
use crate::raw_indexer::RawIndexer;
|
|
||||||
use crate::serde::{extract_document_id, Serializer, RamDocumentStore};
|
|
||||||
use crate::store;
|
|
||||||
use crate::update::{Update, next_update_id};
|
use crate::update::{Update, next_update_id};
|
||||||
use crate::{MResult, Error, RankedMap};
|
use crate::{store, MResult};
|
||||||
|
|
||||||
pub struct SynonymsDeletion {
|
pub struct SynonymsDeletion {
|
||||||
updates_store: store::Updates,
|
updates_store: store::Updates,
|
||||||
@ -77,7 +73,7 @@ pub fn push_synonyms_deletion(
|
|||||||
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
|
let last_update_id = next_update_id(writer, updates_store, updates_results_store)?;
|
||||||
|
|
||||||
let update = Update::SynonymsDeletion(deletion);
|
let update = Update::SynonymsDeletion(deletion);
|
||||||
let update_id = updates_store.put_update(writer, last_update_id, &update)?;
|
updates_store.put_update(writer, last_update_id, &update)?;
|
||||||
|
|
||||||
Ok(last_update_id)
|
Ok(last_update_id)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user