mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
Introduce the core algorithm of task cancelation
This commit is contained in:
parent
6276b2a382
commit
74657bba2c
6 changed files with 57 additions and 20 deletions
|
@ -271,9 +271,10 @@ fn import_dump(
|
|||
log::info!("Importing the settings.");
|
||||
let settings = index_reader.settings()?;
|
||||
apply_settings_to_builder(&settings, &mut builder);
|
||||
builder.execute(|indexing_step| {
|
||||
log::debug!("update: {:?}", indexing_step);
|
||||
})?;
|
||||
builder.execute(
|
||||
|indexing_step| log::debug!("update: {:?}", indexing_step),
|
||||
|| false,
|
||||
)?;
|
||||
|
||||
// 3.3 Import the documents.
|
||||
// 3.3.1 We need to recreate the grenad+obkv format accepted by the index.
|
||||
|
@ -300,6 +301,7 @@ fn import_dump(
|
|||
..Default::default()
|
||||
},
|
||||
|indexing_step| log::debug!("update: {:?}", indexing_step),
|
||||
|| false,
|
||||
)?;
|
||||
|
||||
let (builder, user_result) = builder.add_documents(reader)?;
|
||||
|
|
|
@ -103,6 +103,8 @@ pub struct DetailsView {
|
|||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub matched_tasks: Option<u64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub canceled_tasks: Option<Option<usize>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub deleted_tasks: Option<Option<usize>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub original_query: Option<String>,
|
||||
|
@ -144,6 +146,16 @@ impl From<Details> for DetailsView {
|
|||
deleted_documents: Some(deleted_documents),
|
||||
..DetailsView::default()
|
||||
},
|
||||
Details::TaskCancelation {
|
||||
matched_tasks,
|
||||
canceled_tasks,
|
||||
original_query,
|
||||
} => DetailsView {
|
||||
matched_tasks: Some(matched_tasks),
|
||||
canceled_tasks: Some(canceled_tasks),
|
||||
original_query: Some(original_query),
|
||||
..DetailsView::default()
|
||||
},
|
||||
Details::TaskDeletion {
|
||||
matched_tasks,
|
||||
deleted_tasks,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue