mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
Simplify documents database writing
This commit is contained in:
parent
d59b7db8d0
commit
ebef6bc24d
@ -140,20 +140,9 @@ pub(crate) fn write_typed_chunk_into_index(
|
|||||||
|
|
||||||
for (field_id, value) in reader.iter() {
|
for (field_id, value) in reader.iter() {
|
||||||
let del_add_reader = KvReaderDelAdd::new(value);
|
let del_add_reader = KvReaderDelAdd::new(value);
|
||||||
match (
|
|
||||||
del_add_reader.get(DelAdd::Deletion),
|
if let Some(addition) = del_add_reader.get(DelAdd::Addition) {
|
||||||
del_add_reader.get(DelAdd::Addition),
|
writer.insert(field_id, addition)?;
|
||||||
) {
|
|
||||||
(None, None) => {}
|
|
||||||
(None, Some(value)) => {
|
|
||||||
// anyway, write
|
|
||||||
writer.insert(field_id, value)?;
|
|
||||||
}
|
|
||||||
(Some(_), None) => {}
|
|
||||||
(Some(_), Some(value)) => {
|
|
||||||
// updated field, write
|
|
||||||
writer.insert(field_id, value)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user