mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 05:14:27 +01:00
Fix duplicated fields when a document is modified
This commit is contained in:
parent
a525598ad6
commit
b4102741e6
@ -142,9 +142,9 @@ impl<'d, 'doc: 'd, 't: 'd, Mapper: FieldIdMapper> Document<'d>
|
|||||||
fn iter_top_level_fields(&self) -> impl Iterator<Item = Result<(&'d str, &'d RawValue)>> {
|
fn iter_top_level_fields(&self) -> impl Iterator<Item = Result<(&'d str, &'d RawValue)>> {
|
||||||
let mut new_doc_it = self.new_doc.iter_top_level_fields();
|
let mut new_doc_it = self.new_doc.iter_top_level_fields();
|
||||||
let mut db_it = self.db.iter().flat_map(|db| db.iter_top_level_fields());
|
let mut db_it = self.db.iter().flat_map(|db| db.iter_top_level_fields());
|
||||||
|
let mut seen_fields = BTreeSet::new();
|
||||||
|
|
||||||
std::iter::from_fn(move || {
|
std::iter::from_fn(move || {
|
||||||
let mut seen_fields = BTreeSet::new();
|
|
||||||
if let Some(next) = new_doc_it.next() {
|
if let Some(next) = new_doc_it.next() {
|
||||||
if let Ok((name, _)) = next {
|
if let Ok((name, _)) = next {
|
||||||
seen_fields.insert(name);
|
seen_fields.insert(name);
|
||||||
|
Loading…
Reference in New Issue
Block a user