mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
rebase on main
This commit is contained in:
parent
22ffbf3676
commit
58ef80a2a7
@ -61,7 +61,7 @@ impl CompatV5ToV6 {
|
||||
};
|
||||
Box::new(tasks.map(|task| {
|
||||
task.map(|(task, content_file)| {
|
||||
let task_view: v5::tasks::TaskView = task.into();
|
||||
let task_view: v5::tasks::TaskView = task.clone().into();
|
||||
|
||||
let task = v6::Task {
|
||||
uid: task_view.uid,
|
||||
@ -72,15 +72,35 @@ impl CompatV5ToV6 {
|
||||
v5::Status::Succeeded => v6::Status::Succeeded,
|
||||
v5::Status::Failed => v6::Status::Failed,
|
||||
},
|
||||
kind: match task_view.task_type {
|
||||
v5::Kind::IndexCreation => v6::Kind::IndexCreation,
|
||||
v5::Kind::IndexUpdate => v6::Kind::IndexUpdate,
|
||||
v5::Kind::IndexDeletion => v6::Kind::IndexDeletion,
|
||||
// TODO: this is a `DocumentAdditionOrUpdate` but we still don't have this type in the `TaskView`.
|
||||
v5::Kind::DocumentAdditionOrUpdate => v6::Kind::DocumentAddition,
|
||||
v5::Kind::DocumentDeletion => v6::Kind::DocumentDeletion,
|
||||
v5::Kind::SettingsUpdate => v6::Kind::Settings,
|
||||
v5::Kind::DumpCreation => v6::Kind::DumpExport,
|
||||
kind: match &task.content {
|
||||
v5::tasks::TaskContent::IndexCreation { .. } => v6::Kind::IndexCreation,
|
||||
v5::tasks::TaskContent::IndexUpdate { .. } => v6::Kind::IndexUpdate,
|
||||
v5::tasks::TaskContent::IndexDeletion { .. } => v6::Kind::IndexDeletion,
|
||||
v5::tasks::TaskContent::DocumentAddition {
|
||||
merge_strategy,
|
||||
allow_index_creation,
|
||||
..
|
||||
} => v6::Kind::DocumentImport {
|
||||
method: match merge_strategy {
|
||||
v5::tasks::IndexDocumentsMethod::ReplaceDocuments => {
|
||||
v6::index::milli::update::IndexDocumentsMethod::ReplaceDocuments
|
||||
}
|
||||
v5::tasks::IndexDocumentsMethod::UpdateDocuments => {
|
||||
v6::index::milli::update::IndexDocumentsMethod::UpdateDocuments
|
||||
}
|
||||
},
|
||||
allow_index_creation: allow_index_creation.clone(),
|
||||
},
|
||||
v5::tasks::TaskContent::DocumentDeletion { .. } => {
|
||||
v6::Kind::DocumentDeletion
|
||||
}
|
||||
v5::tasks::TaskContent::SettingsUpdate {
|
||||
allow_index_creation,
|
||||
..
|
||||
} => v6::Kind::Settings {
|
||||
allow_index_creation: allow_index_creation.clone(),
|
||||
},
|
||||
v5::tasks::TaskContent::Dump { .. } => v6::Kind::DumpExport,
|
||||
},
|
||||
details: task_view.details.map(|details| match details {
|
||||
v5::Details::DocumentAddition {
|
||||
|
@ -12,6 +12,7 @@ use uuid::Uuid;
|
||||
use crate::{Error, IndexMetadata, Result, Version};
|
||||
|
||||
use super::{DumpReader, IndexReader};
|
||||
pub use index;
|
||||
|
||||
pub type Metadata = crate::Metadata;
|
||||
|
||||
@ -31,7 +32,7 @@ pub type Kind = index_scheduler::Kind;
|
||||
pub type Details = index_scheduler::Details;
|
||||
|
||||
// everything related to the settings
|
||||
pub type Setting<T> = index::Setting<T>;
|
||||
pub type Setting<T> = index::milli::update::Setting<T>;
|
||||
pub type TypoTolerance = index::updates::TypoSettings;
|
||||
pub type MinWordSizeForTypos = index::updates::MinWordSizeTyposSetting;
|
||||
pub type FacetingSettings = index::updates::FacetingSettings;
|
||||
|
@ -1,3 +1,4 @@
|
||||
pub use milli;
|
||||
pub use search::{
|
||||
all_documents, perform_search, retrieve_document, retrieve_documents, settings,
|
||||
MatchingStrategy, SearchQuery, SearchResult, DEFAULT_CROP_LENGTH, DEFAULT_CROP_MARKER,
|
||||
|
Loading…
Reference in New Issue
Block a user