Skip to content

Commit 0bf10fb

Browse files
committed
Update code-samples according to issue integration-guides/216
1 parent a7d5c30 commit 0bf10fb

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

.code-samples.meilisearch.yaml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,29 @@
44
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
55
---
66
getting_started_faceting: |-
7-
client.index("movies").updateFaceting({ maxValuesPerFacet: 2 })
7+
client.index('movies').update_faceting(max_values_per_facet: 2)
88
getting_started_pagination: |-
9-
client.index("movies").updatePagination({ maxTotalHits: 500 })
9+
client.index('movies').update_pagination(max_total_hits: 500)
1010
synonyms_guide_1: |-
11-
client.index('movies').updateSynonyms({
12-
"great": ["fantastic"],
13-
"fantastic": ["great"]
11+
client.index('movies').update_synonyms({
12+
great: ['fantastic'],
13+
fantastic: ['great']
1414
})
1515
date_guide_index_1: |-
16-
const games = require('./games.json')
17-
client.index('games').addDocuments(games).then((res) => console.log(res))
16+
require 'json'
17+
18+
games = JSON.parse(File.read('games.json'))
19+
client.index('games').add_documents(games)
1820
date_guide_filterable_attributes_1: |-
19-
client.index('games').updateFilterableAttributes({
20-
filterableAttributes: ['release_timestamp']
21-
})
21+
client.index('games').update_filterable_attributes(['release_timestamp'])
2222
date_guide_filter_1: |-
2323
client.index('games').search('', {
2424
filter: 'release_timestamp >= 1514761200 AND release_timestamp < 1672527600'
2525
})
2626
date_guide_sortable_attributes_1: |-
27-
client.index('games').updateSortableAttributes({
28-
sortableAttributes: ['release_timestamp']
29-
})
27+
client.index('games').update_sortable_attributes(['release_timestamp'])
3028
date_guide_sort_1: |-
31-
client.index('games').search('', {
32-
sort: ['release_timestamp:desc'],
33-
})
34-
29+
client.index('games').search('', sort: ['release_timestamp:desc'])
3530
async_guide_filter_by_date_1: |-
3631
client.get_tasks(after_enqueued_at: DateTime.new(2020, 10, 11, 11, 49, 53))
3732

0 commit comments

Comments
 (0)