feat(http): accept empty document additions

wip
This commit is contained in:
mpostma 2022-01-13 12:30:35 +01:00
parent 010dcc3e80
commit d263f762bf
3 changed files with 10 additions and 29 deletions

View file

@ -8,7 +8,7 @@ use indexmap::IndexMap;
use milli::documents::DocumentBatchReader;
use serde::{Deserialize, Serialize};
use crate::document_formats::{read_ndjson, DocumentFormatError};
use crate::document_formats::read_ndjson;
use crate::index::update_handler::UpdateHandler;
use crate::index::updates::apply_settings_to_builder;
@ -130,8 +130,8 @@ impl Index {
let empty = match read_ndjson(reader, &mut tmp_doc_file) {
// if there was no document in the file it's because the index was empty
Ok(0) => true,
Ok(_) => false,
Err(DocumentFormatError::EmptyPayload(_)) => true,
Err(e) => return Err(e.into()),
};