Skip to content

Commit 60e4fb6

Browse files
Merge #669
669: Add ExhaustiveFacetCount parameter r=curquiza a=kashifsoofi # Pull Request ## Related issue Fixes #648 ## What does this PR do? - ... ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - New Features - Added support for an "exhaustive facet count" option in facet search queries, enabling users to request exhaustive counting of facet values. - Documentation - Updated examples and samples to show how to enable the exhaustive facet count option in facet queries. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Kashif Soofi <kashif.soofi+git@gmail.com>
2 parents 1592132 + 303afef commit 60e4fb6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.code-samples.meilisearch.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,7 @@ facet_search_1: |-
834834
facet_search_3: |-
835835
var query = new SearchFacetsQuery()
836836
{
837-
FacetQuery = "c"
837+
FacetQuery = "c",
838+
ExhaustiveFacetCount: true
838839
};
839840
await client.Index("books").FacetSearchAsync("genres", query);

src/Meilisearch/FacetSearchQuery.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,13 @@ public class FacetSearchQuery
4343
/// </summary>
4444
[JsonPropertyName("attributesToSearchOn")]
4545
public IEnumerable<string> AttributesToSearchOn { get; set; }
46+
47+
/// <summary>
48+
/// When true, returns an exhaustive (exact) count for facet values during facet search.
49+
/// This may increase response time on large datasets. Omit or set to false to favor performance.
50+
/// Default (when null/omitted): server defaults apply.
51+
/// </summary>
52+
[JsonPropertyName("exhaustiveFacetCount")]
53+
public bool? ExhaustiveFacetCount { get; set; }
4654
}
4755
}

0 commit comments

Comments
 (0)