fix tests

This commit is contained in:
marin postma
2021-10-24 14:41:36 +02:00
parent 0f86d6b28f
commit 2e62925a6e
8 changed files with 49 additions and 55 deletions

View File

@ -61,10 +61,12 @@ pub fn setup_search_index_with_criteria(criteria: &[Criterion]) -> Index {
let mut cursor = Cursor::new(Vec::new());
let mut documents_builder = DocumentBatchBuilder::new(&mut cursor).unwrap();
let reader = Cursor::new(CONTENT.as_bytes());
todo!();
//for doc in serde_json::Deserializer::from_reader(reader).into_iter::<serde_json::Value>() {
//documents_builder.add_documents(doc.unwrap()).unwrap();
//}
for doc in serde_json::Deserializer::from_reader(reader).into_iter::<serde_json::Value>() {
let doc = Cursor::new(serde_json::to_vec(&doc.unwrap()).unwrap());
documents_builder.extend_from_json(doc).unwrap();
}
documents_builder.finish().unwrap();
cursor.set_position(0);

View File

@ -409,8 +409,8 @@ fn criteria_ascdesc() {
"age": age,
});
todo!();
//batch_builder.add_documents(json).unwrap();
let json = Cursor::new(serde_json::to_vec(&json).unwrap());
batch_builder.extend_from_json(json).unwrap();
});
batch_builder.finish().unwrap();