mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
Merge #2075
2075: Allow payloads with no documents r=irevoire a=MarinPostma accept addition with 0 documents. 0 bytes payload are still refused, since they are not valid json/jsonlines/csv anyways... close #1987 Co-authored-by: mpostma <postma.marin@protonmail.com>
This commit is contained in:
commit
1be3a1e945
3 changed files with 10 additions and 29 deletions
|
@ -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;
|
||||
|
||||
|
@ -128,8 +128,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()),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue