merge with main

This commit is contained in:
Tamo
2021-11-06 16:34:30 +01:00
25 changed files with 824 additions and 953 deletions

View File

@ -61,9 +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());
for doc in serde_json::Deserializer::from_reader(reader).into_iter::<serde_json::Value>() {
documents_builder.add_documents(doc.unwrap()).unwrap();
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,7 +409,8 @@ fn criteria_ascdesc() {
"age": age,
});
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();