Skip to content

Add disableOnNumbers option to typo tolerance settings#506

Open
claudeaceae wants to merge 2 commits intomeilisearch:mainfrom
claudeaceae:feat/disable-on-numbers-typo-tolerance
Open

Add disableOnNumbers option to typo tolerance settings#506
claudeaceae wants to merge 2 commits intomeilisearch:mainfrom
claudeaceae:feat/disable-on-numbers-typo-tolerance

Conversation

@claudeaceae
Copy link
Copy Markdown

@claudeaceae claudeaceae commented Feb 12, 2026

Summary

  • Add disableOnNumbers field to TypoTolerance and TypoToleranceResult models
  • Add unit tests for get and update operations with the new field
  • Add typo_tolerance_guide_5 code sample for the documentation

Closes #480

Related issue

Implements [Meilisearch v1.15] Add disableOnNumbers to typo tolerance settings (#480)

What does this PR do?

Adds support for the disableOnNumbers typo tolerance setting introduced in Meilisearch v1.15. This allows users to deactivate typo tolerance on numeric terms (high entropy words).

Changes

  • TypoTolerance.swift: Added disableOnNumbers: Bool? property and updated initializer
  • TypoToleranceResult.swift: Added disableOnNumbers: Bool property
  • Unit tests: Updated existing test JSON stubs and added testUpdateTypoToleranceDisableOnNumbers
  • Integration tests: Updated defaultTypoToleranceResult to include disableOnNumbers
  • .code-samples.meilisearch.yaml: Added typo_tolerance_guide_5 code sample

PR checklist

  • Targets main branch
  • Add/update unit tests
  • Add code sample under typo_tolerance_guide_5

Summary by CodeRabbit

  • New Features

    • Added a "disable on numbers" option for typo tolerance, letting you exclude numeric values from typo corrections.
  • Tests

    • Expanded unit and integration tests to cover the new disable-on-numbers behavior.
  • Documentation

    • Added a code sample demonstrating how to configure and update the new option.

Implements support for the disableOnNumbers field in typo tolerance
settings, introduced in Meilisearch v1.15. This allows users to
deactivate typo tolerance on numeric terms.

Closes meilisearch#480

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

Adds support for a new typo tolerance setting disableOnNumbers across the SDK: request model, response model, code sample, and tests to exercise reading and updating this setting.

Changes

Cohort / File(s) Summary
Model — Request
Sources/MeiliSearch/Model/TypoTolerance.swift
Added optional disableOnNumbers: Bool? property and initializer parameter to include the flag in outgoing typo tolerance payloads.
Model — Response
Sources/MeiliSearch/Model/TypoToleranceResult.swift
Added disableOnNumbers: Bool to represent the API's typo tolerance response field.
Code Sample
.code-samples.meilisearch.yaml
Added typo_tolerance_guide_5 demonstrating TypoTolerance(disableOnNumbers: true) and updateTypoTolerance usage.
Tests
Tests/MeiliSearchIntegrationTests/SettingsTests.swift, Tests/MeiliSearchUnitTests/SettingsTests.swift
Updated fixtures and assertions to include disableOnNumbers in defaults and added test coverage for updating/reading the new setting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibble on code with a curious twitch,
A new little flag for digits to switch.
Typo hops paused on numbers so bright,
Models and tests all tucked in tight.
Hooray — a small change, a rabbit's delight! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.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 clearly and accurately summarizes the main change: adding a disableOnNumbers option to typo tolerance settings, which is the primary focus of the changeset.
Linked Issues check ✅ Passed The PR successfully implements all coding requirements from issue #480: extends TypoTolerance API with disableOnNumbers property, adds code sample under typo_tolerance_guide_5, and includes unit/integration tests for get and update operations.
Out of Scope Changes check ✅ Passed All changes are directly related to the PR objectives from issue #480; modifications span TypoTolerance model, TypoToleranceResult model, tests, and code samples—all within scope of adding disableOnNumbers support.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


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.

Comment thread .code-samples.meilisearch.yaml
Copy link
Copy Markdown
Collaborator

@Sherlouk Sherlouk left a comment

Choose a reason for hiding this comment

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

Minor comment, otherwise LGTM

Per reviewer feedback, update the disableOnNumbers code sample
to use modern async/await syntax instead of callbacks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claudeaceae
Copy link
Copy Markdown
Author

Updated the code sample to use async/await — thanks for the feedback! I'll use that style going forward.

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

2 participants