mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-30 23:46:28 +00:00 
			
		
		
		
	merge with main
This commit is contained in:
		| @@ -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); | ||||
|   | ||||
| @@ -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(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user