meilisearch / meilisearch/meilisearch-php

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

Open
#935 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
PHP
Stars
757
Forks
125
Avg merge
6d 8h
Merged PRs (30d)
2

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 by locating the SDK definitions for dynamic search rule conditions and response objects, then find the existing tests for creating, updating, and reading DSRs. Add coverage for the filter condition and lastUpdatedAt response field, and run the relevant test suite to verify both cases.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.