Skip to content

Add disableOnNumbers #636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ typo_tolerance_guide_4: |-
two_typos: 10
}
})
typo_tolerance_guide_5: |-
index('books').update_typo_tolerance({ disable_on_numbers: true })
search_parameter_guide_facet_stats_1: |-
client.index('movie_ratings').search('Batman', {
facets: ['genres', 'rating']
Expand Down
8 changes: 5 additions & 3 deletions spec/meilisearch/index/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@
'twoTypos' => 9
},
'disableOnWords' => [],
'disableOnAttributes' => []
'disableOnAttributes' => [],
'disableOnNumbers' => false
}
Comment on lines +587 to 589
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Default expectation is wrong – breaks the test suite.

disableOnNumbers is asserted to be false, but CI shows Meilisearch returns true by default after both creation and reset.
Update the spec to reflect the server’s actual default to unblock the pipeline.

-        'disableOnNumbers' => false
+        'disableOnNumbers' => true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'disableOnAttributes' => [],
'disableOnNumbers' => false
}
'disableOnAttributes' => [],
'disableOnNumbers' => true
}
🤖 Prompt for AI Agents
In spec/meilisearch/index/settings_spec.rb around lines 587 to 589, the test
expects 'disableOnNumbers' to be false by default, but the actual Meilisearch
server returns true after creation and reset. Update the spec to expect
'disableOnNumbers' to be true to match the server's actual default behavior and
fix the failing tests.

end

Expand All @@ -595,8 +596,9 @@
'oneTypo' => 6,
'twoTypos' => 10
},
'disable_on_words' => [],
'disable_on_attributes' => ['title']
'disableOnWords' => ['shrek'],
'disableOnAttributes' => ['title'],
'disableOnNumbers' => true
}
end

Expand Down
Loading