diff --git a/src/update/settings.rs b/src/update/settings.rs index 03f184ef6..141abcf00 100644 --- a/src/update/settings.rs +++ b/src/update/settings.rs @@ -412,6 +412,21 @@ mod tests { let rtxn = index.read_txn().unwrap(); let fields_ids = index.faceted_fields(&rtxn).unwrap(); assert_eq!(fields_ids, hashmap!{ 1 => FacetType::Integer }); + let count = index.facet_field_id_value_docids.len(&rtxn).unwrap(); + assert_eq!(count, 3); + drop(rtxn); + + // Index a little more documents with new and current facets values. + let mut wtxn = index.write_txn().unwrap(); + let content = &b"name,age\nkevin2,23\nkevina2,21\nbenoit2,35\n"[..]; + let mut builder = IndexDocuments::new(&mut wtxn, &index); + builder.update_format(UpdateFormat::Csv); + builder.execute(content, |_| ()).unwrap(); + wtxn.commit().unwrap(); + + let rtxn = index.read_txn().unwrap(); + let count = index.facet_field_id_value_docids.len(&rtxn).unwrap(); + assert_eq!(count, 4); drop(rtxn); } }