mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-26 05:26:27 +00:00 
			
		
		
		
	test: Add a raptor-search bench
This commit is contained in:
		
				
					committed by
					
						 Clément Renault
						Clément Renault
					
				
			
			
				
	
			
			
			
						parent
						
							879e28fb7d
						
					
				
				
					commit
					8fab80048c
				
			
							
								
								
									
										12
									
								
								src/lib.rs
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/lib.rs
									
									
									
									
									
								
							| @@ -9,6 +9,9 @@ pub mod map; | ||||
| pub mod rank; | ||||
| mod levenshtein; | ||||
|  | ||||
| use std::path::Path; | ||||
| use std::fs; | ||||
|  | ||||
| pub use self::map::{Map, MapBuilder, Values}; | ||||
| pub use self::map::{ | ||||
|     OpBuilder, IndexedValues, | ||||
| @@ -101,3 +104,12 @@ impl Match { | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| pub fn load_map<P, Q>(map: P, values: Q) -> fst::Result<DocIndexMap> | ||||
| where P: AsRef<Path>, Q: AsRef<Path>, | ||||
| { | ||||
|     let fst = fs::read(map)?; | ||||
|     let values = fs::read(values)?; | ||||
|     DocIndexMap::from_bytes(fst, &values) | ||||
| } | ||||
|   | ||||
| @@ -334,7 +334,7 @@ impl<'m, 'v, 'a> fst::Streamer<'a> for RankedStream<'m, 'v> { | ||||
|                                 // TODO remove the Pool system ! | ||||
|                                 //      this is an internal Pool rule but | ||||
|                                 //      it is more efficient to test that here | ||||
|                                 if pool.limitation.reached().is_some() && distance != 0 { continue } | ||||
|                                 if pool.limitation.is_reached() && distance != 0 { continue } | ||||
|  | ||||
|                                 let mut matches = HashMap::with_capacity(iv.values.len() / 2); | ||||
|                                 for di in iv.values { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user