Skip to content

[Meilisearch v1.56] Add support for sampledCount in faceting sortFacetValuesBy #1004

Open

Description

@Strift

Context

Meilisearch v1.56.0 introduces sampledCount, a new value for the sortFacetValuesBy faceting setting.

Objective

Update the SDK to support the sampledCount value in faceting.sortFacetValuesBy.

Accepted values: "alpha" (default), "count", "sampledCount". Keys are facet attribute names, "*" is the fallback for all other facets.

PATCH /indexes/{indexUid}/settings/faceting:

{
  "sortFacetValuesBy": {
    "*": "alpha",
    "genres": "sampledCount"
  }
}

Tasks

  • Accept sampledCount as a sortFacetValuesBy value
    • Update the type/enum/constants for the sort value, if the SDK has one
    • Cover get, update, and reset faceting settings
  • Add test cases for the new value
    • Update faceting settings with sampledCount (* and per-attribute) and read them back
  • Add a code sample in .code-samples.meilisearch.yaml, under the update_faceting_settings_1 key, it should be the equivalent of the documentation's CURL example, using sampledCount.

Activity

  1. Pratham2511 commented on Oct 27, 2026

    @Pratham2511

    Hi @Strift, I’d like to work on this. I’ll add the new facet sort value, check its JSON serialization, cover update/read/reset with local v1.56 tests, and add the requested code sample. Could you assign this to me?

  2. cws31 commented on Oct 27, 2026

    @cws31

    hey @Strift i want to work on this issue . I propose adding sampledCount to the SDK’s sortFacetValuesBy type or enum, ensuring get, update, and reset operations correctly support the new value. I’d also add tests for wildcard (*) and per-attribute configurations, verify the settings can be read back, and update update_faceting_settings_1 in .code-samples.meilisearch.yaml with a matching example.

  3. Strift commented on Oct 28, 2026

    @Strift
    ContributorAuthor

    Hello and thanks for your interest!

    Feel free to open a PR for this, but we prefer not to assign issues. This sometimes discourages other contributors from opening a PR, and we've met users who asked to be assigned and never came back.

    We are looking forward to reviewing your PR!

  4. Pratham2511 commented on Oct 28, 2026

    @Pratham2511

    Thanks @Strift, I’ve opened #1005 for this. Please have a look when you get a chance.

  5. cws31 commented on Oct 28, 2026

    @cws31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions