Skip to content

Conversation

@kumarUjjawal
Copy link
Contributor

@kumarUjjawal kumarUjjawal commented Oct 30, 2025

Pull Request

Related issue

Fixes #670

What does this PR do?

  • Added disableOnNumbers to typo tolerance settings
  • Added code samples

PR checklist

Please check if your PR fulfills the following requirements:

  • 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 option to disable typo tolerance for numbers in search matching.
  • Documentation

    • Added code sample demonstrating the new typo tolerance configuration for numbers.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Walkthrough

Adds support for disabling typo tolerance on numbers via a new disable_on_numbers field in the TypoToleranceSettings struct. Includes code sample documentation and updated tests to verify the new configuration option across get, set, and reset operations.

Changes

Cohort / File(s) Summary
Documentation
.code-samples.meilisearch.yaml
New code-sample block typo_tolerance_5 demonstrates configuring disable_on_numbers: Some(true) and applying via set_typo_tolerance on the "movies" index.
Settings & Tests
src/settings.rs
Adds disable_on_numbers: Option<bool> field to TypoToleranceSettings with serde skip-if-none. Updates test expectations for get_typo_tolerance, set_typo_tolerance, and reset_typo_tolerance. Introduces new test test_set_disable_on_numbers verifying the field behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Straightforward field addition with consistent test updates following existing patterns
  • New test case validates basic get/set/reset behavior for the field

Poem

🐰 A number hops into the settings so fine,
With disable_on_numbers, precision's divine!
Typo tolerance yields to entropy's call,
Numbers stand tall, unshaken by all! ✨

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Add disableOnNumbers to typo tolerance settings" directly and clearly describes the primary change in the changeset. The title is specific, concise, and accurately represents the addition of the new disable_on_numbers field to the TypoToleranceSettings struct, which is the main objective of this pull request. The title provides sufficient clarity for a teammate scanning history to understand the key change without being overly verbose.
Out of Scope Changes Check ✅ Passed All code changes in this pull request are directly related to the objective of adding disableOnNumbers functionality to typo tolerance settings. The modifications to src/settings.rs introduce the new struct field and associated tests, while changes to .code-samples.meilisearch.yaml provide documentation examples—all of which are explicitly required by issue #670. No unrelated features, refactoring, or changes outside the defined scope have been introduced.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e90a3c2 and 30c5b31.

📒 Files selected for processing (2)
  • .code-samples.meilisearch.yaml (1 hunks)
  • src/settings.rs (6 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/settings.rs (1)
meilisearch-test-macro/src/lib.rs (1)
  • meilisearch_test (14-201)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: integration-tests
🔇 Additional comments (4)
src/settings.rs (4)

31-33: LGTM! New field follows existing patterns.

The disable_on_numbers field is correctly implemented with appropriate type, serde annotation, and documentation.


1801-1801: Good use of Default trait.

Using ..Default::default() makes the example more maintainable and is a Rust best practice.


3045-3046: Tests correctly reflect default behavior.

The updated tests properly expect disable_on_numbers: Some(false) as the default value returned by the server.

Also applies to: 3064-3064, 3090-3090


3109-3129: Comprehensive test coverage for new field.

The test properly validates setting, retrieving, and resetting the disable_on_numbers field, following the same pattern as other typo tolerance 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 and usage tips.

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.22%. Comparing base (e90a3c2) to head (30c5b31).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #723      +/-   ##
==========================================
+ Coverage   86.18%   86.22%   +0.03%     
==========================================
  Files          20       20              
  Lines        6263     6281      +18     
==========================================
+ Hits         5398     5416      +18     
  Misses        865      865              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[v1.15] Add disableOnNumbers to typo tolerance settings

1 participant