Skip to content

[Meilisearch v1.50.0] Add Dynamic Search Rules (experimental) #981

Description

@Strift

Context

Meilisearch v1.50.0 introduces a revamped Dynamic Search Rules (also called "search rules") experimental feature. Search rules allow pinning documents at the top of search results when flexible, condition-based criteria are matched — such as matching query words, empty queries, or time windows.

This is an experimental feature and must be enabled via PATCH /experimental-features with {"dynamicSearchRules": true} before the endpoints are available.

Objective

Update the SDK to support the search rules API.

We want to expose the following endpoints:

  • List rules: POST /dynamic-search-rules
  • Get a rule: GET /dynamic-search-rules/{uid}
  • Create or update a rule: PATCH /dynamic-search-rules/{uid} (upsert — returns an async task)
  • Delete a rule: DELETE /dynamic-search-rules/{uid} (returns an async task)

For more information, consult:

Tasks

  • Add methods for all four search rules endpoints (list, get, updateOrCreate, delete)
  • Add test cases for all new methods, covering:
    • Listing rules (with pagination and filtering)
    • Retrieving a single rule by UID
    • Creating a new rule (upsert)
    • Updating an existing rule (upsert)
    • Deleting a rule
    • Ensuring that PATCH and DELETE correctly return and handle async tasks
  • Update .code-samples.meilisearch.yaml to add examples under the following keys:

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