mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-15 13:58:36 +02:00
optimize document deserialization
This commit is contained in:
parent
b6af84eb77
commit
8d70b01714
7 changed files with 241 additions and 469 deletions
|
@ -61,9 +61,10 @@ 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();
|
||||
}
|
||||
todo!();
|
||||
//for doc in serde_json::Deserializer::from_reader(reader).into_iter::<serde_json::Value>() {
|
||||
//documents_builder.add_documents(doc.unwrap()).unwrap();
|
||||
//}
|
||||
documents_builder.finish().unwrap();
|
||||
|
||||
cursor.set_position(0);
|
||||
|
|
|
@ -409,7 +409,8 @@ fn criteria_ascdesc() {
|
|||
"age": age,
|
||||
});
|
||||
|
||||
batch_builder.add_documents(json).unwrap();
|
||||
todo!();
|
||||
//batch_builder.add_documents(json).unwrap();
|
||||
});
|
||||
|
||||
batch_builder.finish().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue