Limit the number of values returned by the facet search

This commit is contained in:
Clément Renault
2024-01-10 16:34:40 +01:00
parent 93363b0201
commit 3f3462ab62
3 changed files with 38 additions and 5 deletions

View File

@ -735,6 +735,9 @@ pub fn perform_facet_search(
if let Some(facet_query) = &facet_query {
facet_search.query(facet_query);
}
if let Some(max_facets) = index.max_values_per_facet(&rtxn)? {
facet_search.max_values(max_facets as usize);
}
Ok(FacetSearchResult {
facet_hits: facet_search.execute()?,