mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-29 23:16:26 +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::collections::{BTreeMap, HashMap, HashSet}; | ||||||
|  | use std::fmt::Display; | ||||||
| use std::ops::ControlFlow; | use std::ops::ControlFlow; | ||||||
| use std::{fmt, mem}; | use std::{fmt, mem}; | ||||||
|  |  | ||||||
| @@ -37,6 +38,15 @@ pub enum OrderBy { | |||||||
|     Count, |     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> { | pub struct FacetDistribution<'a> { | ||||||
|     facets: Option<HashMap<String, OrderBy>>, |     facets: Option<HashMap<String, OrderBy>>, | ||||||
|     candidates: Option<RoaringBitmap>, |     candidates: Option<RoaringBitmap>, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user