Update the facet indexing facet test

This commit is contained in:
Clément Renault 2020-11-15 11:06:51 +01:00
parent 9b7e516a56
commit fd8360deb1
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -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);
}
}