mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 14:54:27 +01:00
Don't write an empty _vectors field
This commit is contained in:
parent
2f7a8a4efb
commit
0462ebbe58
@ -234,18 +234,25 @@ pub(crate) fn write_typed_chunk_into_index(
|
|||||||
addition,
|
addition,
|
||||||
)
|
)
|
||||||
else {
|
else {
|
||||||
break 'vectors addition;
|
break 'vectors Some(addition);
|
||||||
};
|
};
|
||||||
vectors.retain_user_provided_vectors();
|
vectors.retain_user_provided_vectors();
|
||||||
serde_json::to_writer(&mut vectors_buffer, &vectors.0)
|
let crate::vector::parsed_vectors::ParsedVectors(vectors) = vectors;
|
||||||
.map_err(InternalError::SerdeJson)?;
|
if vectors.is_empty() {
|
||||||
&vectors_buffer
|
break 'vectors None;
|
||||||
}
|
}
|
||||||
_ => addition,
|
|
||||||
|
serde_json::to_writer(&mut vectors_buffer, &vectors)
|
||||||
|
.map_err(InternalError::SerdeJson)?;
|
||||||
|
Some(vectors_buffer.as_slice())
|
||||||
|
}
|
||||||
|
_ => Some(addition),
|
||||||
};
|
};
|
||||||
|
if let Some(addition) = addition {
|
||||||
writer.insert(field_id, addition)?;
|
writer.insert(field_id, addition)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let db = index.documents.remap_data_type::<Bytes>();
|
let db = index.documents.remap_data_type::<Bytes>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user