Skip to content

Commit 9b05fb3

Browse files
authored
Merge pull request #450 from meilisearch/code-sample-v0.27.0
Updating code-sample for v0.27.0
2 parents ffd9664 + e8f075a commit 9b05fb3

File tree

1 file changed

+61
-2
lines changed

1 file changed

+61
-2
lines changed

.code-samples.meilisearch.yaml

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ update_settings_1: |-
109109
'wolverine': ['xmen', 'logan'],
110110
'logan': ['wolverine']
111111
},
112-
'acceptNewFields': False
112+
'typoTolerance': {
113+
'minWordSizeForTypos': {
114+
'oneTypo': 8,
115+
'twoTypos': 10
116+
},
117+
'disableOnAttributes': ['title']
118+
}
113119
})
114120
reset_settings_1: |-
115121
client.index('movies').reset_settings()
@@ -180,6 +186,20 @@ update_displayed_attributes_1: |-
180186
])
181187
reset_displayed_attributes_1: |-
182188
client.index('movies').reset_displayed_attributes()
189+
get_typo_tolerance_1:
190+
client.index('books').get_typo_tolerance()
191+
update_typo_tolerance_1: |-
192+
client.index('books').update_typo_tolerance({
193+
'minWordSizeForTypos': {
194+
'oneTypo': 4,
195+
'twoTypos': 10
196+
},
197+
'disableOnAttributes': [
198+
'title'
199+
]
200+
})
201+
reset_typo_tolerance_1: |-
202+
client.index('books').reset_typo_tolerance()
183203
get_sortable_attributes_1: |-
184204
client.index('books').get_sortable_attributes()
185205
update_sortable_attributes_1: |-
@@ -243,12 +263,23 @@ search_parameter_guide_retrieve_1: |-
243263
search_parameter_guide_crop_1: |-
244264
client.index('movies').search('shifu', {
245265
'attributesToCrop': ['overview'],
246-
'cropLength': 10
266+
'cropLength': 5
267+
})
268+
search_parameter_guide_crop_marker_1: |-
269+
client.index('movies').search('shifu', {
270+
'attributesToCrop': ['overview'],
271+
'cropMarker': '[…]'
247272
})
248273
search_parameter_guide_highlight_1: |-
249274
client.index('movies').search('winter feast', {
250275
'attributesToHighlight': ['overview']
251276
})
277+
search_parameter_guide_highlight_tag_1: |-
278+
client.index('movies').search('winter feast', {
279+
'attributesToHighlight': ['overview'],
280+
'highlightPreTag': '<span class="highlight">',
281+
'highlightPostTag': '</span>'
282+
})
252283
search_parameter_guide_matches_1: |-
253284
client.index('movies').search('winter feast', {
254285
'matches': 'true'
@@ -309,6 +340,34 @@ settings_guide_sortable_1: |-
309340
'author'
310341
]
311342
})
343+
settings_guide_typo_tolerance_1: |-
344+
client.index('movies').update_typo_tolerance({
345+
'minWordSizeForTypos': {
346+
'twoTypos': 12
347+
},
348+
'disableOnAttributes': [
349+
'title'
350+
]
351+
})
352+
typo_tolerance_guide_1: |-
353+
client.index('movies').update_typo_tolerance({
354+
'enabled': False
355+
})
356+
typo_tolerance_guide_2: |-
357+
client.index('movies').update_typo_tolerance({
358+
'disableOnAttributes': ['title']
359+
})
360+
typo_tolerance_guide_3: |-
361+
client.index('movies').update_typo_tolerance({
362+
'disableOnWords': ['shrek']
363+
})
364+
typo_tolerance_guide_4: |-
365+
client.index('movies').update_typo_tolerance({
366+
'minWordSizeForTypos': {
367+
'oneTypo': 4,
368+
'twoTypos': 10
369+
}
370+
})
312371
add_movies_json_1: |-
313372
import json
314373

0 commit comments

Comments
 (0)