mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-11 14:04:31 +01:00
chore: Move the updates in their own module
This commit is contained in:
parent
b0be06540a
commit
d8cd8c5def
@ -1,6 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
use meilidb_core::DocumentId;
|
||||
use super::Error;
|
||||
use crate::database::Error;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct DocsWordsIndex(pub Arc<sled::Tree>);
|
||||
|
@ -1,8 +1,9 @@
|
||||
use std::sync::Arc;
|
||||
use meilidb_schema::Schema;
|
||||
use crate::ranked_map::RankedMap;
|
||||
|
||||
use super::Error;
|
||||
use meilidb_schema::Schema;
|
||||
|
||||
use crate::ranked_map::RankedMap;
|
||||
use crate::database::Error;
|
||||
|
||||
const SCHEMA_KEY: &str = "schema";
|
||||
const WORDS_KEY: &str = "words";
|
||||
|
@ -13,8 +13,6 @@ use sled::Transactional;
|
||||
use crate::ranked_map::RankedMap;
|
||||
use crate::serde::{Deserializer, DeserializerError};
|
||||
|
||||
use super::Error;
|
||||
|
||||
pub use self::custom_settings_index::CustomSettingsIndex;
|
||||
use self::docs_words_index::DocsWordsIndex;
|
||||
use self::documents_index::DocumentsIndex;
|
||||
@ -22,7 +20,8 @@ use self::main_index::MainIndex;
|
||||
use self::synonyms_index::SynonymsIndex;
|
||||
use self::words_index::WordsIndex;
|
||||
|
||||
use super::{
|
||||
use crate::database::{
|
||||
Error,
|
||||
DocumentsAddition, DocumentsDeletion,
|
||||
SynonymsAddition, SynonymsDeletion,
|
||||
apply_documents_addition, apply_documents_deletion,
|
||||
|
@ -1,4 +1,5 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use meilidb_core::DocIndex;
|
||||
use sdset::{Set, SetBuf};
|
||||
use zerocopy::{LayoutVerified, AsBytes};
|
||||
|
@ -6,24 +6,20 @@ use meilidb_schema::Schema;
|
||||
|
||||
mod error;
|
||||
mod index;
|
||||
|
||||
mod documents_addition;
|
||||
mod documents_deletion;
|
||||
mod synonyms_addition;
|
||||
mod synonyms_deletion;
|
||||
mod update;
|
||||
|
||||
pub use self::error::Error;
|
||||
pub use self::index::{Index, CustomSettingsIndex};
|
||||
|
||||
pub use self::documents_addition::DocumentsAddition;
|
||||
pub use self::documents_deletion::DocumentsDeletion;
|
||||
pub use self::synonyms_addition::SynonymsAddition;
|
||||
pub use self::synonyms_deletion::SynonymsDeletion;
|
||||
pub use self::update::DocumentsAddition;
|
||||
pub use self::update::DocumentsDeletion;
|
||||
pub use self::update::SynonymsAddition;
|
||||
pub use self::update::SynonymsDeletion;
|
||||
|
||||
use self::documents_addition::apply_documents_addition;
|
||||
use self::documents_deletion::apply_documents_deletion;
|
||||
use self::synonyms_addition::apply_synonyms_addition;
|
||||
use self::synonyms_deletion::apply_synonyms_deletion;
|
||||
use self::update::apply_documents_addition;
|
||||
use self::update::apply_documents_deletion;
|
||||
use self::update::apply_synonyms_addition;
|
||||
use self::update::apply_synonyms_deletion;
|
||||
|
||||
fn load_indexes(tree: &sled::Tree) -> Result<HashSet<String>, Error> {
|
||||
match tree.get("indexes")? {
|
||||
|
@ -9,8 +9,7 @@ use crate::indexer::Indexer;
|
||||
use crate::serde::{extract_document_id, Serializer, RamDocumentStore};
|
||||
use crate::RankedMap;
|
||||
|
||||
use super::{Error, Index, apply_documents_deletion};
|
||||
use super::index::Cache;
|
||||
use crate::database::{Error, Index, index::Cache, apply_documents_deletion};
|
||||
|
||||
pub struct DocumentsAddition<'a, D> {
|
||||
index: &'a Index,
|
@ -8,8 +8,7 @@ use sdset::{SetBuf, SetOperation, duo::DifferenceByKey};
|
||||
use crate::RankedMap;
|
||||
use crate::serde::extract_document_id;
|
||||
|
||||
use super::{Index, Error};
|
||||
use super::index::Cache;
|
||||
use crate::database::{Index, Error, index::Cache};
|
||||
|
||||
pub struct DocumentsDeletion<'a> {
|
||||
index: &'a Index,
|
9
meilidb-data/src/database/update/mod.rs
Normal file
9
meilidb-data/src/database/update/mod.rs
Normal file
@ -0,0 +1,9 @@
|
||||
mod documents_addition;
|
||||
mod documents_deletion;
|
||||
mod synonyms_addition;
|
||||
mod synonyms_deletion;
|
||||
|
||||
pub use self::documents_addition::{DocumentsAddition, apply_documents_addition};
|
||||
pub use self::documents_deletion::{DocumentsDeletion, apply_documents_deletion};
|
||||
pub use self::synonyms_addition::{SynonymsAddition, apply_synonyms_addition};
|
||||
pub use self::synonyms_deletion::{SynonymsDeletion, apply_synonyms_deletion};
|
@ -5,8 +5,7 @@ use fst::{SetBuilder, set::OpBuilder};
|
||||
use meilidb_core::normalize_str;
|
||||
use sdset::SetBuf;
|
||||
|
||||
use super::{Error, Index};
|
||||
use super::index::Cache;
|
||||
use crate::database::{Error, Index,index::Cache};
|
||||
|
||||
pub struct SynonymsAddition<'a> {
|
||||
index: &'a Index,
|
@ -6,8 +6,7 @@ use fst::{SetBuilder, set::OpBuilder};
|
||||
use meilidb_core::normalize_str;
|
||||
use sdset::SetBuf;
|
||||
|
||||
use super::{Error, Index};
|
||||
use super::index::Cache;
|
||||
use crate::database::{Error, Index, index::Cache};
|
||||
|
||||
pub struct SynonymsDeletion<'a> {
|
||||
index: &'a Index,
|
Loading…
x
Reference in New Issue
Block a user