Skip to content

[Meilisearch v1.51.0] Add filter condition to Dynamic Search Rules #1267

Description

@Strift

Context

Meilisearch v1.51.0 introduces filter conditions for Dynamic Search Rules (DSR). It also introduces a new lastUpdatedAt field in DSR responses.

Objective

Update the SDK to support:

  • The new filter activation condition in the conditions object of a DSR. The filter condition contains a values key whose value is a JSON object mapping facet names to their expected filter values.
  • The new lastUpdatedAt field returned by GET /dynamic-search-rules/{:ruleUid} and POST /dynamic-search-rules.

Use these resources:

Example of a DSR with a filter condition

// PATCH /dynamic-search-rules/test-filter
{
  "conditions": {
    "filter": {
      "values": {
        "color": "red",
        "category": "shirt"
      }
    }
  },
  "actions": [
    {
      "selector": {
        "indexUid": "products",
        "id": "123"
      },
      "action": { "type": "pin", "position": 1 }
    }
  ]
}

Tasks

  • Update the conditions parameter to accept the new filter condition type
  • Add the lastUpdatedAt field (ISO datetime string) to the API response shape
  • Add tests for:
    • Creating/updating a DSR with a filter condition
    • Reading a DSR response containing lastUpdatedAt

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