Skip to content

Commit 92d9bc0

Browse files
authored
Merge branch 'main' into meili-bot/feb-23-code-samples
2 parents 3f271f2 + 2fc2902 commit 92d9bc0

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

.code-samples.meilisearch.yaml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ add_movies_json_1: |-
335335
client.index('movies').add_documents(movies)
336336
documents_guide_add_movie_1: |-
337337
client.index('movies').add_documents([{
338-
"movie_id": "123sq178",
339-
"title": "Amelie Poulain"
338+
movie_id: '123sq178',
339+
title: 'Amelie Poulain'
340340
}])
341341
getting_started_add_documents_md: |-
342342
```bash
@@ -362,11 +362,33 @@ getting_started_search_md: |-
362362
```
363363
364364
[About this SDK](https://www.github.com/meilisearch/meilisearch-ruby)
365-
faceted_search_update_settings_1: |-
365+
filtering_update_settings_1: |-
366366
client.index('movies').update_filterable_attributes([
367367
'director',
368368
'genres'
369369
])
370+
faceted_search_1: |-
371+
client.index('books').search('classic', {
372+
facets: ['genres', 'rating', 'language']
373+
})
374+
faceted_search_2: |-
375+
client.multi_search([
376+
{
377+
indexUid: 'books',
378+
facets: ['language', 'genres', 'author', 'format'],
379+
filter: [['language = English', 'language = French'], ['genres = Fiction']]
380+
},
381+
{
382+
indexUid: 'books',
383+
facets: ['language'],
384+
filter: [['genres = Fiction']]
385+
},
386+
{
387+
indexUid: 'books',
388+
facets: ['genres'],
389+
filter: [['language = English', 'language = French']]
390+
}
391+
])
370392
faceted_search_filter_1: |-
371393
client.index('movies').search('thriller', {
372394
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
@@ -377,6 +399,8 @@ faceted_search_walkthrough_filter_1: |-
377399
client.index('movies').search('thriller', {
378400
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
379401
})
402+
faceted_search_update_settings_1: |-
403+
client.index('books').update_filterable_attributes(['genres', 'rating', 'language'])
380404
post_dump_1: |-
381405
client.create_dump
382406
phrase_search_1: |-
@@ -415,6 +439,8 @@ geosearch_guide_filter_usage_1: |-
415439
client.index('restaurants').search('', { filter: '_geoRadius(45.472735, 9.184019, 2000)' })
416440
geosearch_guide_filter_usage_2: |-
417441
client.index('restaurants').search('', { filter: '_geoRadius(45.472735, 9.184019, 2000) AND type = pizza' })
442+
geosearch_guide_filter_usage_3: |-
443+
client.index('restaurants').search('', { filter: ['_geoBoundingBox([45.494181, 9.179175], [45.449484, 9.214024])'] })
418444
geosearch_guide_sort_settings_1: |-
419445
client.index('restaurants').update_sortable_attributes(['_geo'])
420446
geosearch_guide_sort_usage_1: |-
@@ -570,3 +596,10 @@ typo_tolerance_guide_4: |-
570596
two_typos: 10
571597
}
572598
})
599+
multi_search_1: |-
600+
client.multi_search([
601+
{ index_uid: 'books', q: 'prince' },
602+
{ index_uid: 'movies', q: 'pooh', limit: 5 }
603+
{ index_uid: 'movies', q: 'nemo', limit: 5 }
604+
{ index_uid: 'movie_ratings', q: 'us' }
605+
])

0 commit comments

Comments
 (0)