Skip to content

Commit f8189c0

Browse files
Merge #636
636: Add disableOnNumbers r=brunoocasali a=Nymuxyzo # Pull Request ## Related issue Fixes #635 ## What does this PR do? Add disableOnNumbers to tests ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a new code sample demonstrating how to enable typo tolerance settings that disable tolerance on numbers for the 'books' index. - **Tests** - Extended test coverage to include the new typo tolerance option for disabling on numbers and updated related test data to reflect current naming and settings conventions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Nymuxyzo <[email protected]>
2 parents 340c9d3 + 74cbcca commit f8189c0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.code-samples.meilisearch.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,8 @@ typo_tolerance_guide_4: |-
594594
two_typos: 10
595595
}
596596
})
597+
typo_tolerance_guide_5: |-
598+
index('books').update_typo_tolerance({ disable_on_numbers: true })
597599
search_parameter_guide_facet_stats_1: |-
598600
client.index('movie_ratings').search('Batman', {
599601
facets: ['genres', 'rating']

spec/meilisearch/index/settings_spec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,8 @@
584584
'twoTypos' => 9
585585
},
586586
'disableOnWords' => [],
587-
'disableOnAttributes' => []
587+
'disableOnAttributes' => [],
588+
'disableOnNumbers' => false
588589
}
589590
end
590591

@@ -595,8 +596,9 @@
595596
'oneTypo' => 6,
596597
'twoTypos' => 10
597598
},
598-
'disable_on_words' => [],
599-
'disable_on_attributes' => ['title']
599+
'disableOnWords' => ['shrek'],
600+
'disableOnAttributes' => ['title'],
601+
'disableOnNumbers' => true
600602
}
601603
end
602604

0 commit comments

Comments
 (0)