Skip to content

Conversation

kashifsoofi
Copy link
Contributor

@kashifsoofi kashifsoofi commented Aug 26, 2025

Pull Request

Related issue

Fixes #648

What does this PR do?

  • ...

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

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.

Copy link

coderabbitai bot commented Aug 26, 2025

Walkthrough

Adds a nullable boolean property ExhaustiveFacetCount to FacetSearchQuery and sets ExhaustiveFacetCount: true in a code sample (.code-samples.meilisearch.yaml) for facet_search_3. No other logic or public signatures changed.

Changes

Cohort / File(s) Summary
Facet search model update
src/Meilisearch/FacetSearchQuery.cs
Adds public nullable bool property ExhaustiveFacetCount with [JsonPropertyName("exhaustiveFacetCount")] to the FacetSearchQuery model.
Code sample adjustment
.code-samples.meilisearch.yaml
Sets ExhaustiveFacetCount: true in facet_search_3 sample and adds a trailing comma after FacetQuery = "c",.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant App as Application
  participant SDK as SDK (FacetSearchQuery)
  participant API as Meilisearch API

  App->>SDK: Create FacetSearchQuery { facetQuery: "c", exhaustiveFacetCount: true }
  SDK->>API: POST /indexes/{id}/facet-search { ..., "exhaustiveFacetCount": true }
  API-->>SDK: 200 OK + facet counts
  SDK-->>App: Facet search response
  note over SDK,API: exhaustiveFacetCount forwarded in request payload
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Update facet search to allow exhaustive facet count (#648) Model and sample updated; no confirmation that the search method/ request serialization and runtime handling were verified/modified.

Poem

I nibble on query leaves with glee,
A tiny flag set—count every tree.
Facets tallied, none left askant,
My fluffy code hops—exhaustive and scant.
🐰✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dc85ec4 and 303afef.

📒 Files selected for processing (2)
  • .code-samples.meilisearch.yaml (1 hunks)
  • src/Meilisearch/FacetSearchQuery.cs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Meilisearch/FacetSearchQuery.cs
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/Meilisearch/FacetSearchQuery.cs (1)

47-51: Enrich the XML doc to describe behavior and trade-offs.

Briefly explain what “exhaustive facet count” does (accurate counts vs. potential performance cost) and its default when omitted.

Apply:

 /// <summary>
-/// Gets or sets the exhaustiveFacetCount property
+/// When true, returns an exhaustive (exact) count for facet values during facet search.
+/// This may increase response time on large datasets. Omit or set to false to favor performance.
+/// Default (when null/omitted): server defaults apply.
 /// </summary>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1592132 and dc85ec4.

📒 Files selected for processing (2)
  • .code-samples.meilisearch.yaml (1 hunks)
  • src/Meilisearch/FacetSearchQuery.cs (1 hunks)
🔇 Additional comments (2)
src/Meilisearch/FacetSearchQuery.cs (2)

47-51: LGTM: Adds optional exhaustiveFacetCount flag without breaking existing callers.

  • Properly mapped with JsonPropertyName("exhaustiveFacetCount").
  • Nullable bool? keeps request payload clean when unset (assuming nulls are ignored globally).

47-51: Nulls in FacetSearchQuery are ignored when serializing

The call to

_http.PostAsJsonAsync(
    $"indexes/{Uid}/facet-search",
    body,
    Constants.JsonSerializerOptionsRemoveNulls,
    cancellationToken: cancellationToken)

passes in JsonSerializerOptionsRemoveNulls, which sets

DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull

so any null properties (including ExhaustiveFacetCount) are excluded from the JSON payload. No changes are needed here.

@kashifsoofi kashifsoofi force-pushed the #648-add-ExhaustiveFacetCount branch from dc85ec4 to 303afef Compare August 26, 2025 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v1.14] Add exhaustive facet search
1 participant