Fix the indexation tests

This commit is contained in:
Kerollmops
2022-06-15 14:35:19 +02:00
parent fcfc4caf8c
commit 399eec5c01
15 changed files with 288 additions and 194 deletions

View File

@ -97,14 +97,15 @@ mod test {
update_method: IndexDocumentsMethod::ReplaceDocuments,
..Default::default()
};
let mut addition =
let addition =
IndexDocuments::new(&mut txn, &index, &config, indexing_config, |_| ()).unwrap();
let reader =
crate::documents::DocumentsBatchReader::from_reader(Cursor::new(JSON.as_slice()))
.unwrap();
addition.add_documents(reader).unwrap();
let (addition, user_error) = addition.add_documents(reader).unwrap();
user_error.unwrap();
addition.execute().unwrap();
let fields_map = index.fields_ids_map(&txn).unwrap();

View File

@ -648,10 +648,11 @@ mod tests {
let config = IndexerConfig::default();
let indexing_config = IndexDocumentsConfig::default();
let mut builder =
let builder =
IndexDocuments::new(&mut wtxn, &index, &config, indexing_config.clone(), |_| ())
.unwrap();
builder.add_documents(content).unwrap();
let (builder, user_error) = builder.add_documents(content).unwrap();
user_error.unwrap();
builder.execute().unwrap();
wtxn.commit().unwrap();