meilisearch / meilisearch/meilisearch-python

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

Open
#1,267 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
Python
Stars
602
Forks
118
Avg merge
4h 44m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SDK implementation for dynamic search rules and the request/response handling for PATCH /dynamic-search-rules/{:ruleUid}, GET /dynamic-search-rules/{:ruleUid}, and POST /dynamic-search-rules. Check the release notes and API reference for the expected shapes, then add coverage for the filter condition and lastUpdatedAt response field. Done means both behaviors are accepted and returned correctly by the SDK tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.