Replace the BTreeMap by an IndexMap to return values in order

This commit is contained in:
Kerollmops 2023-05-29 15:47:45 +02:00 committed by Clément Renault
parent 34b2e98fe9
commit a385642ec3
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
5 changed files with 53 additions and 15 deletions

View file

@ -6,6 +6,7 @@ use std::time::Instant;
use deserr::Deserr;
use either::Either;
use index_scheduler::RoFeatures;
use indexmap::IndexMap;
use log::warn;
use meilisearch_auth::IndexSearchRules;
use meilisearch_types::deserr::DeserrJsonError;
@ -279,7 +280,7 @@ pub struct SearchResult {
#[serde(flatten)]
pub hits_info: HitsInfo,
#[serde(skip_serializing_if = "Option::is_none")]
pub facet_distribution: Option<BTreeMap<String, BTreeMap<String, u64>>>,
pub facet_distribution: Option<BTreeMap<String, IndexMap<String, u64>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub facet_stats: Option<BTreeMap<String, FacetStats>>,
}