Skip to content

Commit 91333e6

Browse files
committed
Update code-sample
1 parent 5e4f33e commit 91333e6

File tree

1 file changed

+50
-66
lines changed

1 file changed

+50
-66
lines changed

.code-samples.meilisearch.yaml

Lines changed: 50 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,68 +3,6 @@
33
# the documentation on build
44
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
55
---
6-
multi_search_1: |-
7-
see cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L996-L1017
8-
multi-search with data: { "queries": [
9-
{
10-
"indexUid": "movies",
11-
"q": "pooh",
12-
"limit": 5
13-
},
14-
{
15-
"indexUid": "movies",
16-
"q": "nemo",
17-
"limit": 5
18-
},
19-
{
20-
"indexUid": "movie_ratings",
21-
"q": "us"
22-
}
23-
]
24-
}
25-
faceted_search_update_settings_1: |-
26-
See cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L1018-L1024
27-
on the books index: Add "genres", "rating", "language" as filterable attributes
28-
faceted_search_1: |-
29-
See cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L1025-L1034
30-
Search books index with data: {
31-
"q": "classic",
32-
"facets": [
33-
"genres", "rating", "language"
34-
]
35-
}
36-
search_parameter_guide_facet_stats_1: |-
37-
See cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L1035-L1042
38-
search movie_ratings index with data: '{
39-
"q": "Batman",
40-
"facets": ["genres", "rating"]
41-
}
42-
faceted_search_2: |-
43-
see cURL: https://github.com/meilisearch/documentation/blob/5ec3df3844f603f0958d91a0c5cfc38bc57656af/.code-samples.meilisearch.yaml#L1043-L1065
44-
multi-search with data: {
45-
"queries": [
46-
{
47-
"indexUid": "books",
48-
"facets": ["language", "genres", "author", "format"],
49-
"filter": [["language = English", "language = French"], ["genres = Fiction"]]
50-
},
51-
{
52-
"indexUid": "books",
53-
"facets": ["language"],
54-
"filter": [["genres = Fiction"]]
55-
},
56-
{
57-
"indexUid": "books",
58-
"facets": ["genres"],
59-
"filter": [["language = English", "language = French"]]
60-
}
61-
]
62-
}
63-
geosearch_guide_filter_usage_3: |-
64-
see cURL: https://github.com/meilisearch/documentation/blob/c8ab47d004753ce2241a756eff14ade448d70a93/.code-samples.meilisearch.yaml#L696-L700
65-
Search on `restaurants` with data:
66-
'{ "filter": "_geoBoundingBox([45.494181, 9.179175], [45.449484, 9.214024])" }'
67-
686
get_one_index_1: |-
697
client.get_index('movies')
708
list_all_indexes_1: |-
@@ -107,6 +45,14 @@ delete_documents_1: |-
10745
client.index('movies').delete_documents([23488, 153738, 437035, 363869])
10846
search_post_1: |-
10947
client.index('movies').search('American ninja')
48+
multi_search_1: |-
49+
client.multi_search(
50+
[
51+
{'indexUid': 'movies', 'q': 'pooh', 'limit': 5},
52+
{'indexUid': 'movies', 'q': 'nemo', 'limit': 5},
53+
{'indexUid': 'movie_ratings', 'q': 'us'}
54+
]
55+
)
11056
get_all_tasks_1: |-
11157
client.get_tasks()
11258
get_task_1: |-
@@ -372,6 +318,14 @@ search_parameter_guide_hitsperpage_1: |-
372318
client.index('movies').search('', {'hitsPerPage': 15})
373319
search_parameter_guide_page_1: |-
374320
client.index('movies').search('', {'page': 2})
321+
search_parameter_guide_sort_1: |-
322+
client.index('books').search('science fiction', {
323+
'sort': ['price:asc']
324+
})
325+
search_parameter_guide_facet_stats_1: |-
326+
client.index('movie_ratings').search('Batman', {
327+
'facets': ['genres', 'rating']
328+
})
375329
settings_guide_synonyms_1: |-
376330
client.index('tops').update_settings({
377331
'synonyms': {
@@ -589,6 +543,36 @@ faceted_search_walkthrough_filter_1: |-
589543
client.index('movies').search('thriller', {
590544
'filter': [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
591545
})
546+
faceted_search_update_settings_1: |-
547+
client.index('books').update_filterable_attributes([
548+
'genres',
549+
'director',
550+
'language'
551+
])
552+
faceted_search_1: |-
553+
client.index('books').search('classic', {
554+
'facets': ['genres', 'rating', 'language']
555+
})
556+
faceted_search_2: |-
557+
client.multi_search(
558+
[
559+
{
560+
'indexUid': 'books',
561+
'facets': ['language', 'genres', 'author', 'format'],
562+
'filter': [['language = English', 'language = French'], ['genres = Fiction']]
563+
},
564+
{
565+
'indexUid': 'books',
566+
'facets': ['language'],
567+
'filter': [['genres = Fiction']]
568+
},
569+
{
570+
'indexUid': 'books',
571+
'facets': ['genres'],
572+
'filter': [['language = English', 'language = French']]
573+
},
574+
]
575+
)
592576
post_dump_1: |-
593577
client.create_dump()
594578
phrase_search_1: |-
@@ -615,10 +599,6 @@ sorting_guide_sort_parameter_2: |-
615599
client.index('books').search('butler', {
616600
'sort': ['author:desc']
617601
})
618-
search_parameter_guide_sort_1: |-
619-
client.index('books').search('science fiction', {
620-
'sort': ['price:asc']
621-
})
622602
geosearch_guide_filter_settings_1: |-
623603
client.index('restaurants').update_filterable_attributes([
624604
'_geo'
@@ -643,6 +623,10 @@ geosearch_guide_sort_usage_2: |-
643623
client.index('restaurants').search('', {
644624
'sort': ['_geoPoint(48.8561446,2.2978204):asc', 'rating:desc']
645625
})
626+
geosearch_guide_filter_usage_3: |-
627+
client.index('restaurants').search('Batman', {
628+
'filter': '_geoBoundingBox([45.494181, 9.179175], [45.449484, 9.214024])'
629+
})
646630
primary_field_guide_update_document_primary_key: |-
647631
client.index('books').update(primary_key='title')
648632
primary_field_guide_create_index_primary_key: |-

0 commit comments

Comments
 (0)