mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
Merge #229
229: Add exhaustiveFacetsCount r=MarinPostma a=curquiza
I completely forgot this one 😅
Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
This commit is contained in:
commit
0ebe3900e0
@ -74,6 +74,8 @@ pub struct SearchResult {
|
|||||||
pub processing_time_ms: u128,
|
pub processing_time_ms: u128,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub facets_distribution: Option<BTreeMap<String, BTreeMap<String, u64>>>,
|
pub facets_distribution: Option<BTreeMap<String, BTreeMap<String, u64>>>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub exhaustive_facets_count: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
@ -211,6 +213,8 @@ impl Index {
|
|||||||
None => None,
|
None => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let exhaustive_facets_count = facets_distribution.as_ref().map(|_| false); // not implemented yet
|
||||||
|
|
||||||
let result = SearchResult {
|
let result = SearchResult {
|
||||||
exhaustive_nb_hits: false, // not implemented yet
|
exhaustive_nb_hits: false, // not implemented yet
|
||||||
hits: documents,
|
hits: documents,
|
||||||
@ -220,6 +224,7 @@ impl Index {
|
|||||||
offset: query.offset.unwrap_or_default(),
|
offset: query.offset.unwrap_or_default(),
|
||||||
processing_time_ms: before_search.elapsed().as_millis(),
|
processing_time_ms: before_search.elapsed().as_millis(),
|
||||||
facets_distribution,
|
facets_distribution,
|
||||||
|
exhaustive_facets_count,
|
||||||
};
|
};
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user