Skip to content

Add dynamic search rules support#1265

Merged
Strift merged 1 commit into
meilisearch:mainfrom
fjbarrett:feat/dynamic-search-rules
Jul 21, 2026
Merged

Add dynamic search rules support#1265
Strift merged 1 commit into
meilisearch:mainfrom
fjbarrett:feat/dynamic-search-rules

Conversation

@fjbarrett

@fjbarrett fjbarrett commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What changed

  • add typed list and single-rule responses for Dynamic Search Rules
  • expose list, get, upsert, and delete client methods, including custom task metadata
  • cover pagination, filtering, retrieval, create, partial update, delete, and async task handling
  • add the four requested documentation code samples

Verification

  • uv run pytest tests (374 passed, 5 skipped against Meilisearch v1.50.0, commit 2ecfd54)
  • uv run mypy meilisearch
  • uv run ruff check meilisearch tests
  • uv run ruff format --check meilisearch tests
  • yamllint .code-samples.meilisearch.yaml
  • parsed all four new samples as Python syntax

API schema note

The current documentation PATCH sample uses priority and an array-shaped conditions. The released v1.50.0 binary rejects that payload; it accepts precedence and an object with query / time conditions. The Python sample follows the released server contract. I recorded the mismatch on #1264 for confirmation.

AI assistance

OpenAI Codex assisted with API research, implementation, tests, and the initial PR text. I reviewed every changed line, ran the complete test suite against the v1.50.0 binary, and take responsibility for the contribution.

Closes #1264

Summary by CodeRabbit

  • New Features
    • Added support for managing dynamic search rules.
    • List rules with pagination and filters, retrieve individual rules, and create or update rules.
    • Delete dynamic search rules and track the resulting tasks.
    • Added documentation examples covering rule listing, retrieval, updates, and deletion.

Expose the v1.50 experimental endpoints with typed responses and task metadata so callers can list, retrieve, upsert, and delete rules. Cover the released API contract with integration tests and executable documentation samples.

Co-Authored-By: Codex <codex@openai.com>
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bf182c5d-cc9b-4e21-91d7-00d31a96d232

📥 Commits

Reviewing files that changed from the base of the PR and between 69188f7 and 4ea8b6e.

📒 Files selected for processing (6)
  • .code-samples.meilisearch.yaml
  • meilisearch/client.py
  • meilisearch/config.py
  • meilisearch/models/search_rule.py
  • tests/client/test_client_dynamic_search_rules_meilisearch.py
  • tests/conftest.py

📝 Walkthrough

Walkthrough

The SDK adds typed dynamic search rule models, route configuration, four client methods, experimental-feature test setup, lifecycle coverage, and documentation samples for listing, retrieving, updating, and deleting rules.

Changes

Dynamic Search Rules

Layer / File(s) Summary
Search rule models and route configuration
meilisearch/models/search_rule.py, meilisearch/config.py
Adds SearchRule and SearchRulesResults models and registers the dynamic-search-rules route.
Dynamic search rule client operations
meilisearch/client.py, .code-samples.meilisearch.yaml
Adds typed list, retrieve, upsert, and delete methods, including optional task metadata and matching documentation examples.
Lifecycle tests and feature fixture
tests/conftest.py, tests/client/test_client_dynamic_search_rules_meilisearch.py
Enables and cleans up the experimental feature, then tests pagination, filtering, retrieval, upsert behavior, task metadata, updates, and deletion.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Meilisearch
  participant TaskService
  Client->>Meilisearch: List or retrieve dynamic search rules
  Client->>Meilisearch: Upsert or delete a rule
  Meilisearch-->>Client: SearchRule, SearchRulesResults, or TaskInfo
  Client->>TaskService: Wait for asynchronous task
  TaskService-->>Client: Completed task
Loading

Possibly related issues

  • meilisearch/meilisearch-rust 797 — Covers the same Dynamic Search Rules API implementation.
  • meilisearch/meilisearch-dart 495 — Covers equivalent SDK endpoints, models, tests, fixtures, and samples.
  • meilisearch/meilisearch-java 981 — Covers equivalent Dynamic Search Rules SDK support.
  • meilisearch/meilisearch-ruby 708 — Covers the same endpoints, models, tests, and documentation.
  • meilisearch/meilisearch-swift 528 — Covers equivalent endpoints, fixtures, tests, and samples.

Suggested reviewers: qorexdevs

Poem

I’m a rabbit with rules in my hat,
Pinning each carrot just so—fancy that!
List, fetch, patch, delete,
Tasks hop on their feet,
While docs bloom where examples grow.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding dynamic search rules support.
Linked Issues check ✅ Passed The PR covers the four required endpoints, tests async task handling, adds docs samples, and enables the experimental feature.
Out of Scope Changes check ✅ Passed The changes appear focused on dynamic search rules support, with no clear unrelated additions.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Strift Strift added the enhancement New feature or request label Jul 21, 2026

@Strift Strift left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @fjbarrett and thank you for this PR 🙌 LGTM!

@Strift
Strift added this pull request to the merge queue Jul 21, 2026
Merged via the queue into meilisearch:main with commit 03e0690 Jul 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants