mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-26 05:26:27 +00:00 
			
		
		
		
	facet distribution: implement Display for OrderBy
This commit is contained in:
		| @@ -1,4 +1,5 @@ | ||||
| use std::collections::{BTreeMap, HashMap, HashSet}; | ||||
| use std::fmt::Display; | ||||
| use std::ops::ControlFlow; | ||||
| use std::{fmt, mem}; | ||||
|  | ||||
| @@ -37,6 +38,15 @@ pub enum OrderBy { | ||||
|     Count, | ||||
| } | ||||
|  | ||||
| impl Display for OrderBy { | ||||
|     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||||
|         match self { | ||||
|             OrderBy::Lexicographic => f.write_str("alphabetically"), | ||||
|             OrderBy::Count => f.write_str("by count"), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub struct FacetDistribution<'a> { | ||||
|     facets: Option<HashMap<String, OrderBy>>, | ||||
|     candidates: Option<RoaringBitmap>, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user