Skip to content

Commit 828e9de

Browse files
committed
Updateing code-sample for v0.27.0
1 parent ffd9664 commit 828e9de

File tree

1 file changed

+60
-2
lines changed

1 file changed

+60
-2
lines changed

.code-samples.meilisearch.yaml

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ 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+
'disableOnAttributes': ['title']
117+
}
113118
})
114119
reset_settings_1: |-
115120
client.index('movies').reset_settings()
@@ -180,6 +185,20 @@ update_displayed_attributes_1: |-
180185
])
181186
reset_displayed_attributes_1: |-
182187
client.index('movies').reset_displayed_attributes()
188+
get_typo_tolerance_1:
189+
client.index('books').get_typo_tolerance()
190+
update_typo_tolerance_1: |-
191+
client.index('books').update_typo_tolerance({
192+
'minWordSizeForTypos': {
193+
'oneTypo': 4,
194+
'twoTypos': 10
195+
},
196+
'disableOnAttributes': [
197+
'title'
198+
]
199+
})
200+
reset_typo_tolerance_1: |-
201+
client.index('books').reset_typo_tolerance()
183202
get_sortable_attributes_1: |-
184203
client.index('books').get_sortable_attributes()
185204
update_sortable_attributes_1: |-
@@ -243,12 +262,23 @@ search_parameter_guide_retrieve_1: |-
243262
search_parameter_guide_crop_1: |-
244263
client.index('movies').search('shifu', {
245264
'attributesToCrop': ['overview'],
246-
'cropLength': 10
265+
'cropLength': 5
266+
})
267+
search_parameter_guide_crop_marker_1: |-
268+
client.index('movies').search('shifu', {
269+
'attributesToCrop': ['overview'],
270+
'cropMarker': '[…]'
247271
})
248272
search_parameter_guide_highlight_1: |-
249273
client.index('movies').search('winter feast', {
250274
'attributesToHighlight': ['overview']
251275
})
276+
search_parameter_guide_highlight_tag_1: |-
277+
client.index('movies').search('winter feast', {
278+
'attributesToHighlight': ['overview'],
279+
'highlightPreTag': '<span class=\"highlight\">',
280+
'highlightPostTag': '</span>'
281+
})
252282
search_parameter_guide_matches_1: |-
253283
client.index('movies').search('winter feast', {
254284
'matches': 'true'
@@ -309,6 +339,34 @@ settings_guide_sortable_1: |-
309339
'author'
310340
]
311341
})
342+
settings_guide_typo_tolerance_1: |-
343+
client.index('movies').update_typo_tolerance({
344+
'minWordSizeForTypos': {
345+
'twoTypos': 12
346+
},
347+
'disableOnAttributes': [
348+
'title'
349+
]
350+
})
351+
typo_tolerance_guide_1: |-
352+
client.index('movies').update_typo_tolerance({
353+
'enabled': False
354+
})
355+
typo_tolerance_guide_2: |-
356+
client.index('movies').update_typo_tolerance({
357+
'disableOnAttributes': ['title']
358+
})
359+
typo_tolerance_guide_3: |-
360+
client.index('movies').update_typo_tolerance({
361+
'disableOnWords': ['shrek']
362+
})
363+
typo_tolerance_guide_4: |-
364+
client.index('movies').update_typo_tolerance({
365+
'minWordSizeForTypos': {
366+
'oneTypo': 4,
367+
'twoTypos': 10
368+
}
369+
})
312370
add_movies_json_1: |-
313371
import json
314372

0 commit comments

Comments
 (0)