Skip to content

Commit e4429d4

Browse files
committed
Update code samples and README with new snake_case options
1 parent 734ff2f commit e4429d4

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

.code-samples.meilisearch.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ get_one_index_1: |-
88
list_all_indexes_1: |-
99
client.indexes
1010
create_an_index_1: |-
11-
client.create_index('movies', primaryKey: 'movie_id')
11+
client.create_index('movies', primary_key: 'movie_id')
1212
update_an_index_1: |-
13-
client.index('movies').update(primaryKey: 'movie_id')
13+
client.index('movies').update(primary_key: 'movie_id')
1414
delete_an_index_1: |-
1515
client.delete_index('movies')
1616
get_one_document_1: |-
@@ -53,7 +53,7 @@ get_settings_1: |-
5353
client.index('movies').settings
5454
update_settings_1: |-
5555
client.index('movies').update_settings({
56-
rankingRules: [
56+
ranking_rules: [
5757
'words',
5858
'typo',
5959
'proximity',
@@ -63,24 +63,24 @@ update_settings_1: |-
6363
'release_date:desc',
6464
'rank:desc'
6565
],
66-
distinctAttribute: 'movie_id',
67-
searchableAttributes: [
66+
distinct_attribute: 'movie_id',
67+
searchable_attributes: [
6868
'title',
6969
'description',
7070
'genre'
7171
],
72-
displayedAttributes: [
72+
displayed_attributes: [
7373
'title',
7474
'description',
7575
'genre',
7676
'release_date'
7777
],
78-
stopWords: [
78+
stop_words: [
7979
'the',
8080
'a',
8181
'an'
8282
],
83-
sortableAttributes: [
83+
sortable_attributes: [
8484
'title',
8585
'release_date'
8686
],
@@ -176,7 +176,7 @@ field_properties_guide_searchable_1: |-
176176
])
177177
field_properties_guide_displayed_1: |-
178178
client.index('movies').update_settings({
179-
displayedAttributes: [
179+
displayed_attributes: [
180180
'title',
181181
'description',
182182
'genre',
@@ -207,16 +207,16 @@ search_parameter_guide_limit_1: |-
207207
})
208208
search_parameter_guide_retrieve_1: |-
209209
client.index('movies').search('shifu', {
210-
attributesToRetrieve: ['overview', 'title']
210+
attributes_to_retrieve: ['overview', 'title']
211211
})
212212
search_parameter_guide_crop_1: |-
213213
client.index('movies').search('shifu', {
214-
attributesToCrop: ['overview'],
214+
attributes_to_crop: ['overview'],
215215
cropLength: 10
216216
})
217217
search_parameter_guide_highlight_1: |-
218218
client.index('movies').search('winter feast', {
219-
attributesToHighlight: ['overview']
219+
attributes_to_highlight: ['overview']
220220
})
221221
search_parameter_guide_matches_1: |-
222222
client.index('movies').search('winter feast', {
@@ -239,15 +239,15 @@ settings_guide_synonyms_1: |-
239239
})
240240
settings_guide_stop_words_1: |-
241241
client.index('movies').update_settings({
242-
stopWords: [
242+
stop_words: [
243243
'the',
244244
'a',
245245
'an'
246246
]
247247
})
248248
settings_guide_ranking_rules_1: |-
249249
client.index('movies').update_settings({
250-
rankingRules: [
250+
ranking_rules: [
251251
'words',
252252
'typo',
253253
'proximity',
@@ -262,15 +262,15 @@ settings_guide_distinct_1: |-
262262
client.index('jackets').update_distinct_attribute('product_id')
263263
settings_guide_searchable_1: |-
264264
client.index('movies').update_settings({
265-
searchableAttributes: [
265+
searchable_attributes: [
266266
'title',
267267
'description',
268268
'genre'
269269
]
270270
})
271271
settings_guide_displayed_1: |-
272272
client.index('movies').update_settings({
273-
displayedAttributes: [
273+
displayed_attributes: [
274274
'title',
275275
'description',
276276
'genre',
@@ -332,7 +332,7 @@ faceted_search_filter_1: |-
332332
})
333333
faceted_search_facets_distribution_1: |-
334334
client.index('movies').search('Batman', {
335-
facetsDistribution: ['genres']
335+
facets_distribution: ['genres']
336336
})
337337
faceted_search_walkthrough_filterable_attributes_1: |-
338338
client.index('movies').update_filterable_attributes([
@@ -347,7 +347,7 @@ faceted_search_walkthrough_filter_1: |-
347347
})
348348
faceted_search_walkthrough_facets_distribution_1: |-
349349
client.index('movies').search('Batman', {
350-
facetsDistribution: ['genres']
350+
facets_distribution: ['genres']
351351
})
352352
post_dump_1: |-
353353
client.create_dump

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ All the supported options are described in the [search parameters](https://docs.
124124
```ruby
125125
index.search(
126126
'wonder',
127-
attributesToHighlight: ['*']
127+
attributes_to_highlight: ['*']
128128
)
129129
```
130130

0 commit comments

Comments
 (0)