Skip to content

docs: add search rules documentation#3554

Open
YoEight wants to merge 3 commits intomainfrom
dsr
Open

docs: add search rules documentation#3554
YoEight wants to merge 3 commits intomainfrom
dsr

Conversation

@YoEight
Copy link
Copy Markdown
Member

@YoEight YoEight commented Apr 12, 2026

Description

Add documentation for the (dynamic) search rules experimental feature.

Checklist

For internal Meilisearch team member only:

For external maintainers

  • 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.
  • Have you made sure that the title is accurate and descriptive of the changes?

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation for the experimental Search Rules feature, including getting-started guides, how-to articles, and advanced behavior documentation covering document pinning based on query or time conditions, rule management, and promotion scheduling.

@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 12, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
meilisearch-documentation 🟢 Ready View Preview Apr 12, 2026, 8:31 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@YoEight YoEight requested a review from qdequele April 12, 2026 20:29
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

📝 Walkthrough

Walkthrough

Added comprehensive documentation for a new experimental "Search rules" feature that enables curating search results by pinning documents based on query text or time-window conditions. Includes overview, getting-started guide, how-to guides, advanced behavior documentation, and navigation updates.

Changes

Cohort / File(s) Summary
Search Rules Core Documentation
capabilities/search_rules/overview.mdx, capabilities/search_rules/getting_started.mdx, capabilities/search_rules/advanced/pinning_behavior.mdx
New documentation pages covering search rules feature overview, end-to-end setup via dashboard and API, and detailed pinning behavior across ranking, filtering, precedence, and result composition.
Search Rules How-To Guides
capabilities/search_rules/how_to/pin_one_result_for_query.mdx, capabilities/search_rules/how_to/pin_multiple_results.mdx, capabilities/search_rules/how_to/curate_empty_query.mdx, capabilities/search_rules/how_to/schedule_promotion.mdx, capabilities/search_rules/how_to/list_and_filter_rules.mdx, capabilities/search_rules/how_to/pause_a_rule.mdx
Six new how-to guides covering practical usage patterns: pinning single/multiple results, handling empty queries, scheduling time-limited promotions, listing/filtering rules, and pausing rules.
Navigation and Reference Updates
config/navigation.json, capabilities/overview.mdx, resources/help/experimental_features_overview.mdx
Added navigation structure for search rules feature, updated main capabilities overview with "curation" keyword and search rules card, and added search rules entry to experimental features table.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 With search rules so fine, we curate with pride,
Pinning documents where they should reside,
From queries to schedules, conditions align,
Empty searches curated in perfect design!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main objective: comprehensive documentation for the search rules feature with multiple new pages covering overview, setup, how-to guides, and advanced topics.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dsr

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
capabilities/search_rules/advanced/pinning_behavior.mdx (1)

31-31: Rephrase to avoid meta-language in user-facing documentation.

The sentence "Describe it as a case-insensitive literal substring match..." sounds like internal guidance for documentation writers rather than direct explanation to users.

✍️ Suggested rewording
-The query condition `contains` is a strict substring match. Describe it as a case-insensitive literal substring match, not as fuzzy, semantic, or pattern-aware matching.
+The query condition `contains` performs a case-insensitive literal substring match. It is not a fuzzy, semantic, or pattern-aware match.

As per coding guidelines: Prefer short, direct sentences and avoid jargon when a simpler term exists in documentation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@capabilities/search_rules/advanced/pinning_behavior.mdx` at line 31, The
sentence currently uses meta-documentation language; update the user-facing
description of the query operator `contains` to a short, direct phrase such as
"Performs a case-insensitive literal substring match" (avoid words like
"describe" or internal guidance), and replace the existing sentence so the docs
state plainly what `contains` does without jargon or meta-instructions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@capabilities/search_rules/advanced/pinning_behavior.mdx`:
- Line 31: The sentence currently uses meta-documentation language; update the
user-facing description of the query operator `contains` to a short, direct
phrase such as "Performs a case-insensitive literal substring match" (avoid
words like "describe" or internal guidance), and replace the existing sentence
so the docs state plainly what `contains` does without jargon or
meta-instructions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8f7b2d68-df5f-436f-b8d8-7c931e56f276

📥 Commits

Reviewing files that changed from the base of the PR and between 04e9e1f and 732ee7b.

📒 Files selected for processing (8)
  • capabilities/overview.mdx
  • capabilities/search_rules/advanced/pinning_behavior.mdx
  • capabilities/search_rules/getting_started.mdx
  • capabilities/search_rules/how_to/pinning_patterns.mdx
  • capabilities/search_rules/overview.mdx
  • capabilities/search_rules/reference.mdx
  • config/navigation.json
  • resources/help/experimental_features_overview.mdx

- Overview now follows the capability-overview pattern (When to use,
  How it works with a mermaid diagram, Key concepts, Use cases,
  Current scope, Next steps) and drops the standalone Rule structure
  JSON block in favor of a narrative Key concepts section.
- Getting started gets a Cloud UI walkthrough with 6 dashboard
  screenshots (activate add-on, create rule, manage rule, add
  condition, add pin, rules list), followed by the same flow via the
  API. Generic Prerequisites block dropped.
- How-to switched from FAQ-style "How do I..." headings to
  task-oriented ones to match other capability how_to pages.
- Advanced: storage model replaces the duplicated "Current scope"
  section; meta-language around the contains matcher rewritten as
  plain prose.
- Current scope mentions boosting, demoting, and burying as planned
  future actions, and links to book a call for use cases not yet
  covered.
- reference.mdx removed; the auto-generated API reference in the
  References tab is the source of truth.
Replace the monolithic pinning_patterns page with six task-oriented how-to
pages (pin one, pin multiple, curate empty query, schedule promotion, list
and filter, pause a rule) and point every API reference card to the correct
operation-level URL.
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
capabilities/search_rules/how_to/pause_a_rule.mdx (1)

6-6: Split this long intro sentence for readability.

Line 6 is doing too much in one pass. Breaking it into 2–3 shorter sentences will make the setup easier to scan.

As per coding guidelines, “Prefer shorter sentences; if a sentence runs over approximately 40 words, consider splitting or simplifying.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@capabilities/search_rules/how_to/pause_a_rule.mdx` at line 6, The intro
sentence beginning "Sometimes you need to stop a rule from applying without
losing its configuration..." is too long; split it into 2–3 shorter sentences
for readability: 1) state the situations (campaign ended early, pinned doc
review, misbehaving rule) as a short sentence or list, 2) follow with a separate
sentence explaining that flipping a rule to inactive stops it from firing at
search time while preserving conditions, actions, and metadata, and 3)
optionally add a final short sentence noting you can reactivate it later with
one click or one API call; update the paragraph containing that long sentence
accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@capabilities/search_rules/how_to/curate_empty_query.mdx`:
- Around line 38-40: The explanation for the "Query is empty" condition
currently only mentions missing `q` or `""`; update the text for the `Query is
empty` condition to also state that it matches whitespace-only `q` values (e.g.,
`"   "`), so the behavior is consistent with the description later (Line 98) and
users understand that blank/whitespace-only queries are treated as empty; edit
the sentence that currently reads "The condition simply asserts that the search
request has no `q` value, or that `q` is an empty string." to include
whitespace-only `q` values as well.

In `@capabilities/search_rules/how_to/list_and_filter_rules.mdx`:
- Around line 49-50: Update the example filter pattern under the
attributePatterns key from "promo*" to "promo-*" so it matches the documented
rule ID prefix "promo-"; locate the JSON snippet where attributePatterns is
defined (the example with "attributePatterns": ["promo*"]) and replace the value
accordingly (also apply the same change to the other occurrence referenced
around the later example).

---

Nitpick comments:
In `@capabilities/search_rules/how_to/pause_a_rule.mdx`:
- Line 6: The intro sentence beginning "Sometimes you need to stop a rule from
applying without losing its configuration..." is too long; split it into 2–3
shorter sentences for readability: 1) state the situations (campaign ended
early, pinned doc review, misbehaving rule) as a short sentence or list, 2)
follow with a separate sentence explaining that flipping a rule to inactive
stops it from firing at search time while preserving conditions, actions, and
metadata, and 3) optionally add a final short sentence noting you can reactivate
it later with one click or one API call; update the paragraph containing that
long sentence accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eed99571-d71d-47ea-936d-55990f06d118

📥 Commits

Reviewing files that changed from the base of the PR and between 732ee7b and 3b0723b.

⛔ Files ignored due to path filters (6)
  • assets/images/cloud-search-rules/01-activate-addon.png is excluded by !**/*.png
  • assets/images/cloud-search-rules/02-create-first-rule.png is excluded by !**/*.png
  • assets/images/cloud-search-rules/03-manage-rule.png is excluded by !**/*.png
  • assets/images/cloud-search-rules/04-add-condition.png is excluded by !**/*.png
  • assets/images/cloud-search-rules/05-add-pin.png is excluded by !**/*.png
  • assets/images/cloud-search-rules/06-rules-list.png is excluded by !**/*.png
📒 Files selected for processing (10)
  • capabilities/search_rules/advanced/pinning_behavior.mdx
  • capabilities/search_rules/getting_started.mdx
  • capabilities/search_rules/how_to/curate_empty_query.mdx
  • capabilities/search_rules/how_to/list_and_filter_rules.mdx
  • capabilities/search_rules/how_to/pause_a_rule.mdx
  • capabilities/search_rules/how_to/pin_multiple_results.mdx
  • capabilities/search_rules/how_to/pin_one_result_for_query.mdx
  • capabilities/search_rules/how_to/schedule_promotion.mdx
  • capabilities/search_rules/overview.mdx
  • config/navigation.json
✅ Files skipped from review due to trivial changes (7)
  • config/navigation.json
  • capabilities/search_rules/how_to/pin_one_result_for_query.mdx
  • capabilities/search_rules/how_to/schedule_promotion.mdx
  • capabilities/search_rules/how_to/pin_multiple_results.mdx
  • capabilities/search_rules/overview.mdx
  • capabilities/search_rules/advanced/pinning_behavior.mdx
  • capabilities/search_rules/getting_started.mdx

Comment on lines +38 to +40
`Query is empty` has no additional fields to fill. The condition simply asserts that the search request has no `q` value, or that `q` is an empty string.

Click **Add condition** to save.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Include whitespace-only queries in the condition explanation.

This section says Query is empty matches missing q or "", but Line 98 also says it matches whitespace-only q. Add that here too so behavior is stated consistently in one place.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@capabilities/search_rules/how_to/curate_empty_query.mdx` around lines 38 -
40, The explanation for the "Query is empty" condition currently only mentions
missing `q` or `""`; update the text for the `Query is empty` condition to also
state that it matches whitespace-only `q` values (e.g., `"   "`), so the
behavior is consistent with the description later (Line 98) and users understand
that blank/whitespace-only queries are treated as empty; edit the sentence that
currently reads "The condition simply asserts that the search request has no `q`
value, or that `q` is an empty string." to include whitespace-only `q` values as
well.

Comment thread capabilities/search_rules/how_to/list_and_filter_rules.mdx
@qdequele
Copy link
Copy Markdown
Member

@YoEight, can you confirm that the content is still valid?

I've made a few changes:

  • Removed the reference since it is under /api/reference
  • Added some use cases in the overview
  • Split the "how to" section into one file per example
  • Added some cloud UI

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants