Skip to content

Align Dynamic Search Rules with Meilisearch v1.53 - #759

Open
Strift wants to merge 1 commit into
mainfrom
chore/update-tests-for-v1.53
Open

Align Dynamic Search Rules with Meilisearch v1.53#759
Strift wants to merge 1 commit into
mainfrom
chore/update-tests-for-v1.53

Conversation

@Strift

@Strift Strift commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Related issue

Fixes tests failing against the latest Meilisearch build

What does this PR do?

  • Align Dynamic Search Rules with the current API: priorityprecedence, and conditions as an object (query/time/filter) instead of an array.
  • Treat create, update, and delete as async tasks (TaskInfo) instead of returning the rule or a boolean.
  • Update tests, fixtures, datasets, and code samples so they wait for those tasks and match the new contract.

PR checklist

Please check if your PR fulfills the following requirements:

  • Did you use any AI tool while implementing this PR (code, tests, docs, etc.)? If yes, disclose it in the PR description and describe what it was used for. AI usage is allowed when it is disclosed.
  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

Summary by CodeRabbit

  • New Features
    • Added structured dynamic search rule conditions for query, time, and facet filters.
    • Added query-based filtering when listing dynamic search rules.
    • Added support for clearing all dynamic search rules.
  • Changes
    • Renamed rule and patch precedence from priority to precedence.
    • Dynamic search rule create, update, and delete operations now return task information for progress tracking.
    • Added task types for dynamic search rule updates and clearing.
  • Bug Fixes
    • Improved handling and verification of asynchronous rule operations.

Nightly/latest now uses precedence, object-shaped conditions, and async mutation tasks, which was breaking the .NET integration suite.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Strift Strift added the maintenance Anything related to maintenance (CI, tests, refactoring...) label Aug 26, 2026
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

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 Plus

Run ID: ff88b332-05b1-4da6-bd6d-fb743e3c98fb

📥 Commits

Reviewing files that changed from the base of the PR and between ea0e4c8 and 47f5c74.

📒 Files selected for processing (12)
  • .code-samples.meilisearch.yaml
  • src/Meilisearch/Converters/BaseObjectWithTypesConverter.cs
  • src/Meilisearch/DynamicSearchRule.Condition.cs
  • src/Meilisearch/DynamicSearchRule.cs
  • src/Meilisearch/MeilisearchClient.cs
  • src/Meilisearch/PatchDynamicSearchRule.cs
  • src/Meilisearch/QueryParameters/DynamicSearchRulesQuery.cs
  • src/Meilisearch/TaskInfo.cs
  • tests/Meilisearch.Tests/Datasets/dynamic_search_rule.json
  • tests/Meilisearch.Tests/Datasets/dynamic_search_rule_with_optional_values.json
  • tests/Meilisearch.Tests/DynamicSearchRuleTests.cs
  • tests/Meilisearch.Tests/Fixtures/DynamicSearchRuleFixture.cs
💤 Files with no reviewable changes (1)
  • src/Meilisearch/Converters/BaseObjectWithTypesConverter.cs

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Dynamic search rules now use structured conditions and precedence. Rule mutations return asynchronous TaskInfo values, and bulk deletion is supported. Query filtering, task types, examples, fixtures, and tests were updated.

Changes

Dynamic search rule API

Layer / File(s) Summary
Structured rule contracts
src/Meilisearch/DynamicSearchRule.Condition.cs, src/Meilisearch/DynamicSearchRule.cs, src/Meilisearch/PatchDynamicSearchRule.cs, src/Meilisearch/Converters/...
Conditions now use a DynamicSearchRuleConditions object with query, time, and filter entries. Priority is replaced by Precedence. LastUpdatedAt is added.
Asynchronous rule operations
src/Meilisearch/MeilisearchClient.cs, src/Meilisearch/TaskInfo.cs, src/Meilisearch/QueryParameters/...
Create, update, and delete methods return TaskInfo. A method for deleting all rules is added. Dynamic rule queries now support query and remove attribute_patterns.
Examples and behavioral validation
.code-samples.meilisearch.yaml, tests/Meilisearch.Tests/Datasets/..., tests/Meilisearch.Tests/DynamicSearchRuleTests.cs, tests/Meilisearch.Tests/Fixtures/...
Examples, fixtures, and tests use structured conditions and precedence. Tests wait for task completion before retrieval and deletion assertions.

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

Merge Risk: ⚪ Minimal · up to 47f5c

This PR updates Dynamic Search Rules to match the Meilisearch v1.53 API and adjusts related tests, fixtures, and samples; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant MeilisearchClient
  participant MeilisearchAPI
  Caller->>MeilisearchClient: CreateOrUpdateDynamicSearchRuleAsync or DeleteDynamicSearchRuleAsync
  MeilisearchClient->>MeilisearchAPI: Send rule operation request
  MeilisearchAPI-->>MeilisearchClient: Return TaskInfo
  MeilisearchClient-->>Caller: Return TaskInfo
Loading

Suggested reviewers: clonediff

Poem

A rabbit packs conditions neat,
With precedence in its basket sweet.
Tasks hop back with ears held high,
Query words sparkle in the sky.
Rules now wait, then safely spring.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 8 files. (3 skipped: … 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 clearly identifies the main change: updating Dynamic Search Rules to match the Meilisearch v1.53 API.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 15.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 8 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/update-tests-for-v1.53

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.

@helgebergo

helgebergo commented Sep 3, 2026

Copy link
Copy Markdown

Gentle bump on this one, it currently blocks other PRs. Created a new PR #763 that fails tests, due to these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Anything related to maintenance (CI, tests, refactoring...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants