mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-29 16:24:26 +01:00
remove an old unworking part of the batch execution
This commit is contained in:
parent
c2899fe9b2
commit
7a0f17c912
@ -12,7 +12,6 @@ pub(crate) enum Batch {
|
|||||||
Cancel(Task),
|
Cancel(Task),
|
||||||
Snapshot(Vec<Task>),
|
Snapshot(Vec<Task>),
|
||||||
Dump(Vec<Task>),
|
Dump(Vec<Task>),
|
||||||
// IndexSpecific { index_uid: String, kind: BatchKind },
|
|
||||||
DocumentAddition {
|
DocumentAddition {
|
||||||
index_uid: String,
|
index_uid: String,
|
||||||
primary_key: Option<String>,
|
primary_key: Option<String>,
|
||||||
@ -476,46 +475,7 @@ impl IndexScheduler {
|
|||||||
settings: _,
|
settings: _,
|
||||||
settings_tasks: _,
|
settings_tasks: _,
|
||||||
} => {
|
} => {
|
||||||
let mut wtxn = self.env.write_txn()?;
|
todo!();
|
||||||
let index = self.index_mapper.create_index(&mut wtxn, &index_uid)?;
|
|
||||||
wtxn.commit()?;
|
|
||||||
let mut updated_tasks = Vec::new();
|
|
||||||
|
|
||||||
/*
|
|
||||||
let ret = index.update_settings(settings)?;
|
|
||||||
for (ret, task) in ret.iter().zip(settings_tasks) {
|
|
||||||
match ret {
|
|
||||||
Ok(ret) => task.status = Some(ret),
|
|
||||||
Err(err) => task.error = Some(err),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
for (ret, task) in ret.iter().zip(settings_tasks) {
|
|
||||||
match ret {
|
|
||||||
Ok(ret) => task.status = Some(ret),
|
|
||||||
Err(err) => task.error = Some(err),
|
|
||||||
}
|
|
||||||
updated_tasks.push(task);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
let ret = index.update_documents(
|
|
||||||
IndexDocumentsMethod::ReplaceDocuments,
|
|
||||||
primary_key,
|
|
||||||
self.file_store.clone(),
|
|
||||||
content_files.into_iter(),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
for (ret, mut task) in ret.iter().zip(document_addition_tasks.into_iter()) {
|
|
||||||
match ret {
|
|
||||||
Ok(ret) => todo!(), // task.info = Some(format!("{:?}", ret)),
|
|
||||||
Err(err) => todo!(), // task.error = Some(err.to_string()),
|
|
||||||
}
|
|
||||||
updated_tasks.push(task);
|
|
||||||
}
|
|
||||||
Ok(updated_tasks)
|
|
||||||
}
|
}
|
||||||
Batch::DocumentUpdate {
|
Batch::DocumentUpdate {
|
||||||
index_uid,
|
index_uid,
|
||||||
@ -561,19 +521,3 @@ impl IndexScheduler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
impl Batch {
|
|
||||||
pub fn task_ids(&self) -> impl IntoIterator<Item = TaskId> + '_ {
|
|
||||||
match self {
|
|
||||||
Batch::Cancel(task) | Batch::One(task) => {
|
|
||||||
Box::new(std::iter::once(task.uid)) as Box<dyn Iterator<Item = TaskId>>
|
|
||||||
}
|
|
||||||
Batch::Snapshot(tasks) | Batch::Dump(tasks) | Batch::Contiguous { tasks, .. } => {
|
|
||||||
Box::new(tasks.iter().map(|task| task.uid)) as Box<dyn Iterator<Item = TaskId>>
|
|
||||||
}
|
|
||||||
Batch::Empty => Box::new(std::iter::empty()) as Box<dyn Iterator<Item = TaskId>>,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
Loading…
Reference in New Issue
Block a user