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
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F
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()?,