mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
add facet count in response
This commit is contained in:
parent
f1ac76a283
commit
7c7f753463
3 changed files with 13 additions and 3 deletions
|
@ -30,7 +30,7 @@ pub struct SortResult {
|
|||
pub nb_hits: usize,
|
||||
pub exhaustive_nb_hit: bool,
|
||||
pub facets: Option<HashMap<String, HashMap<String, usize>>>,
|
||||
pub exhaustive_facet_count: Option<bool>,
|
||||
pub exhaustive_facets_count: Option<bool>,
|
||||
}
|
||||
|
||||
pub fn bucket_sort<'c, FI>(
|
||||
|
@ -118,7 +118,7 @@ where
|
|||
|
||||
if let Some(f) = facet_count_docids {
|
||||
// hardcoded value, until approximation optimization
|
||||
result.exhaustive_facet_count = Some(true);
|
||||
result.exhaustive_facets_count = Some(true);
|
||||
result.facets = Some(facet_count(f, &docids));
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ where
|
|||
|
||||
if let Some(f) = facet_count_docids {
|
||||
// hardcoded value, until approximation optimization
|
||||
result.exhaustive_facet_count = Some(true);
|
||||
result.exhaustive_facets_count = Some(true);
|
||||
result.facets = Some(facet_count(f, &docids));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue