@@ -19,34 +19,34 @@ get_documents_1: |-
19
19
.getDocuments(params: DocumentsQuery(limit: 2, filter: 'genres = action'));
20
20
multi_search_1 : |-
21
21
await client.multiSearch(MultiSearchQuery(queries: [
22
- SearchQuery (
22
+ IndexSearchQuery (
23
23
query: "pooh",
24
24
indexUid: "movies",
25
25
limit: 5
26
26
),
27
- SearchQuery (
27
+ IndexSearchQuery (
28
28
query: "nemo",
29
29
indexUid: "movies",
30
30
limit: 5
31
31
),
32
- SearchQuery (
32
+ IndexSearchQuery (
33
33
query: "us",
34
34
indexUid: "movies_ratings"
35
35
),
36
36
]));
37
37
faceted_search_2 : |-
38
38
await client.multiSearch(MultiSearchQuery(queries: [
39
- SearchQuery (
39
+ IndexSearchQuery (
40
40
indexUid: 'books',
41
41
facets: ['language', 'genres', 'author', 'format'],
42
42
filter: [['language = English', 'language = French'], ['genres = Fiction']]
43
43
),
44
- SearchQuery (
44
+ IndexSearchQuery (
45
45
indexUid: 'books',
46
46
facets: ['language'],
47
47
filter: [['genres = Fiction']]
48
48
),
49
- SearchQuery (
49
+ IndexSearchQuery (
50
50
indexUid: "books",
51
51
facets: ['genres'],
52
52
filter: [['language = English', 'language = French']]
@@ -55,17 +55,13 @@ faceted_search_2: |-
55
55
faceted_search_update_settings_1 : |-
56
56
await client.index('books').updateFilterableAttributes(['genres', 'rating', 'language']);
57
57
search_parameter_guide_facet_stats_1 : |-
58
- await client.index('movie_ratings').search('Batman', facets: ['genres', 'rating']);
58
+ await client.index('movie_ratings').search('Batman', SearchQuery( facets: ['genres', 'rating']) );
59
59
faceted_search_1 : |-
60
- await client.index('books').search('', facets: ['genres', 'rating', 'language']);
60
+ await client.index('books').search('', SearchQuery( facets: ['genres', 'rating', 'language']) );
61
61
filtering_guide_nested_1 : |-
62
- await client.index('movie_ratings').search('thriller', {
63
- filter: 'rating.users >= 90'
64
- })
62
+ await client.index('movie_ratings').search('thriller', SearchQuery(filter: 'rating.users >= 90'));
65
63
sorting_guide_sort_nested_1 : |-
66
- await client.index('books').search('science fiction', {
67
- sort: ["rating.users:asc"],
68
- })
64
+ await client.index('movie_ratings').search('thriller', SearchQuery(sort: ["rating.users:asc"]));
69
65
async_guide_filter_by_date_1 : |-
70
66
await client.getTasks(params: TasksQuery(afterEnqueuedAt: DateTime(2020, 10, 11, 11, 49, 53)));
71
67
async_guide_multiple_filters_1 : |-
@@ -87,9 +83,9 @@ async_guide_canceled_by: |-
87
83
swap_indexes_1 : |-
88
84
await client.swapIndexes([SwapIndex(['indexA', 'indexB']), SwapIndex(['indexX', 'indexY'])]);
89
85
search_parameter_guide_hitsperpage_1 : |-
90
- await client.index('movies').search('', hitsPerPage: 15) as PaginatedSearchResult;
86
+ await client.index('movies').search('', SearchQuery( hitsPerPage: 15) ) as PaginatedSearchResult;
91
87
search_parameter_guide_page_1 : |-
92
- await client.index('movies').search('', page: 2) as PaginatedSearchResult;
88
+ await client.index('movies').search('', SearchQuery( page: 2) ) as PaginatedSearchResult;
93
89
getting_started_faceting : |-
94
90
getting_started_pagination : |-
95
91
synonyms_guide_1 : |-
@@ -102,25 +98,24 @@ date_guide_index_1: |-
102
98
import 'dart:convert';
103
99
104
100
final json = await File('games.json').readAsString();
105
- final games = jsonDecode(json);
106
101
107
- await client.index('games').addDocuments(games );
102
+ await client.index('games').addDocumentsJson(json );
108
103
date_guide_filterable_attributes_1 : |-
109
104
await client.index('games').updateFilterableAttributes(['release_timestamp']);
110
105
date_guide_filter_1 : |-
111
106
await client.index('games').search('',
112
- filter:
113
- 'release_timestamp >= 1514761200 AND release_timestamp < 1672527600');
107
+ SearchQuery( filter:
108
+ 'release_timestamp >= 1514761200 AND release_timestamp < 1672527600')) ;
114
109
date_guide_sortable_attributes_1 : |-
115
110
await client.index('games').updateSortableAttributes(['release_timestamp']);
116
111
date_guide_sort_1 : |-
117
- await client.index('games').search('', sort: ['release_timestamp:desc']);
112
+ await client.index('games').search('', SearchQuery( sort: ['release_timestamp:desc']) );
118
113
getting_started_typo_tolerance : |-
119
114
120
115
get_all_tasks_paginating_1 : |-
121
- await client.getTasks(params: TasksQuery(limit: 2, from: 10);
116
+ await client.getTasks(params: TasksQuery(limit: 2, from: 10)) ;
122
117
get_all_tasks_paginating_2 : |-
123
- await client.getTasks(params: TasksQuery(limit: 2, from: 8);
118
+ await client.getTasks(params: TasksQuery(limit: 2, from: 8)) ;
124
119
get_pagination_settings_1 : |-
125
120
update_pagination_settings_1 : |-
126
121
reset_pagination_settings_1 : |-
@@ -288,45 +283,47 @@ field_properties_guide_displayed_1: |-
288
283
filtering_guide_1 : |-
289
284
await await client
290
285
.index('movies')
291
- .search('Avengers', filter: 'release_date > 795484800');
286
+ .search('Avengers', SearchQuery( filter: 'release_date > 795484800') );
292
287
filtering_guide_2 : |-
293
- await client.index('movies').search('Batman',
294
- filter:
295
- 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")');
288
+ await client.index('movies')
289
+ .search('Batman',
290
+ SearchQuery(filter: 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")'
291
+ )
292
+ );
296
293
filtering_guide_3 : |-
297
294
await client.index('movies').search('Planet of the Apes',
298
- filter: 'rating >= 3 AND (NOT director = "Tim Burton")');
295
+ SearchQuery( filter: 'rating >= 3 AND (NOT director = "Tim Burton")') );
299
296
search_parameter_guide_query_1 : |-
300
297
await client.index('movies').search('shifu');
301
298
search_parameter_guide_offset_1 : |-
302
- await client.index('movies').search('shifu', offset: 1);
299
+ await client.index('movies').search('shifu', SearchQuery( offset: 1) );
303
300
search_parameter_guide_limit_1 : |-
304
- await client.index('movies').search('shifu', limit: 2);
301
+ await client.index('movies').search('shifu', SearchQuery( limit: 2) );
305
302
search_parameter_guide_matching_strategy_1 : |-
306
- await client.index('movies').search('big fat liar', matchingStrategy: MatchingStrategy.last);
303
+ await client.index('movies').search('big fat liar', SearchQuery( matchingStrategy: MatchingStrategy.last) );
307
304
search_parameter_guide_matching_strategy_2 : |-
308
- await client.index('movies').search('big fat liar', matchingStrategy: MatchingStrategy.all);
305
+ await client.index('movies').search('big fat liar', SearchQuery( matchingStrategy: MatchingStrategy.all) );
309
306
search_parameter_guide_retrieve_1 : |-
310
307
await client
311
308
.index('movies')
312
- .search('shifu', attributesToRetrieve: ['overview', 'title']);
309
+ .search('shifu', SearchQuery( attributesToRetrieve: ['overview', 'title']) );
313
310
search_parameter_guide_crop_1 : |-
314
311
await client
315
312
.index('movies')
316
- .search('shifu', attributesToCrop: ['overview'], cropLength: 5);
313
+ .search('shifu', SearchQuery( attributesToCrop: ['overview'], cropLength: 5) );
317
314
search_parameter_guide_highlight_1 : |-
318
315
await client
319
316
.index('movies')
320
- .search('winter feast', attributesToHighlight: ['overview']);
317
+ .search('winter feast', SearchQuery( attributesToHighlight: ['overview']) );
321
318
search_parameter_guide_show_matches_position_1 : |-
322
- await client.index('movies').search('winter feast', showMatchesPosition: true);
319
+ await client.index('movies').search('winter feast', SearchQuery( showMatchesPosition: true) );
323
320
add_movies_json_1 : |-
324
321
import 'dart:io';
325
322
import 'dart:convert';
326
323
327
- final jsonFile = await File('movies.json').readAsString();
328
- final movies = jsonDecode(jsonFile);
329
- await client.index('movies').addDocuments(movies );
324
+ final json = await File('movies.json').readAsString();
325
+
326
+ await client.index('movies').addDocumentsJson(json );
330
327
documents_guide_add_movie_1 : |-
331
328
await client.index('movies').addDocuments([
332
329
{ 'movie_id': '123sq178', 'title': 'Amélie Poulain' }
@@ -358,9 +355,9 @@ getting_started_add_documents_md: |-
358
355
359
356
var client = MeiliSearchClient('http://localhost:7700', 'masterKey');
360
357
361
- final jsonFile = await File('movies.json').readAsString();
362
- final movies = jsonDecode(jsonFile);
363
- await client.index('movies').addDocuments(movies );
358
+ final json = await File('movies.json').readAsString();
359
+
360
+ await client.index('movies').addDocumentsJson(json );
364
361
```
365
362
366
363
[About this SDK](https://github.com/meilisearch/meilisearch-dart/)
@@ -404,40 +401,39 @@ getting_started_communicating_with_a_protected_instance: |-
404
401
var client = MeiliSearchClient('http://localhost:7700', 'apiKey');
405
402
await client.index('movies').search('');
406
403
getting_started_add_meteorites : |-
407
- final jsonFile = await File('meteorites.json').readAsString();
408
- final meteorites = jsonDecode(jsonFile);
404
+ final json = await File('meteorites.json').readAsString();
409
405
410
- await client.index('meteorites').addDocuments(meteorites );
406
+ await client.index('meteorites').addDocumentsJson(json );
411
407
getting_started_configure_settings : |-
412
408
await client.index('meteorites').updateSettings(IndexSettings(
413
409
filterableAttributes: ['mass', '_geo'],
414
410
sortableAttributes: ['mass', '_geo']
415
411
));
416
412
getting_started_geo_radius : |-
417
- await client.index('meteorites').search('', filter: '_geoRadius(46.9480, 7.4474, 210000)');
413
+ await client.index('meteorites').search('', SearchQuery( filter: '_geoRadius(46.9480, 7.4474, 210000)') );
418
414
getting_started_geo_point : |-
419
- await client.index('meteorites').search('', sort: ['_geoPoint(48.8583701, 2.2922926):asc']);
415
+ await client.index('meteorites').search('', SearchQuery( sort: ['_geoPoint(48.8583701, 2.2922926):asc']) );
420
416
getting_started_sorting : |-
421
- await client.index('meteorites').search('', sort: ['mass:asc'], filter: 'mass < 200');
417
+ await client.index('meteorites').search('', SearchQuery( sort: ['mass:asc'], filter: 'mass < 200') );
422
418
getting_started_filtering : |-
423
- await client.index('meteorites').search('', filter: 'mass < 200');
419
+ await client.index('meteorites').search('', SearchQuery( filter: 'mass < 200') );
424
420
filtering_update_settings_1 : |-
425
421
await client.index('movies').updateFilterableAttributes([
426
422
'director',
427
423
'genres',
428
424
]);
429
425
faceted_search_filter_1 : |-
430
- await client.index('movies').search('thriller', filter: [
426
+ await client.index('movies').search('thriller', SearchQuery( filter: [
431
427
['genres = Horror', 'genres = Mystery'],
432
428
'director = "Jordan Peele"'
433
- ]);
429
+ ])) ;
434
430
faceted_search_facets_1 : |-
435
- await client.index('movies').search('Batman', facets: ['genres']);
431
+ await client.index('movies').search('Batman', SearchQuery( facets: ['genres']) );
436
432
faceted_search_walkthrough_filter_1 : |-
437
- await client.index('movies').search('thriller', filter: [
433
+ await client.index('movies').search('thriller', SearchQuery( filter: [
438
434
['genres = Horror', 'genres = Mystery'],
439
435
'director = "Jordan Peele"'
440
- ]);
436
+ ])) ;
441
437
post_dump_1 : |-
442
438
await client.createDump();
443
439
phrase_search_1 : |-
@@ -454,9 +450,9 @@ sorting_guide_update_ranking_rules_1: |-
454
450
'exactness'
455
451
]);
456
452
sorting_guide_sort_parameter_1 : |-
457
- await client.index('books').search('science fiction', sort: ['price:asc']);
453
+ await client.index('books').search('science fiction', SearchQuery( sort: ['price:asc']) );
458
454
sorting_guide_sort_parameter_2 : |-
459
- await client.index('books').search('butler', sort: ['author:desc']);
455
+ await client.index('books').search('butler', SearchQuery( sort: ['author:desc']) );
460
456
get_sortable_attributes_1 : |-
461
457
await client.index('books').getSortableAttributes();
462
458
update_sortable_attributes_1 : |-
@@ -467,23 +463,23 @@ update_sortable_attributes_1: |-
467
463
reset_sortable_attributes_1 : |-
468
464
await client.index('books').resetSortableAttributes();
469
465
search_parameter_guide_sort_1 : |-
470
- await client.index('books').search('science fiction', sort: ['price:asc']);
466
+ await client.index('books').search('science fiction', SearchQuery( sort: ['price:asc']) );
471
467
geosearch_guide_filter_settings_1 : |-
472
468
await client.index('restaurants').updateFilterableAttributes(['_geo']);
473
469
geosearch_guide_filter_usage_1 : |-
474
470
await await client
475
471
.index('restaurants')
476
- .search('', filter: '_geoRadius(45.472735, 9.184019, 2000)');
472
+ .search('', SearchQuery( filter: '_geoRadius(45.472735, 9.184019, 2000)') );
477
473
geosearch_guide_filter_usage_2 : |-
478
474
await await client
479
475
.index('restaurants')
480
- .search('', filter: '_geoRadius(45.472735, 9.184019, 2000) AND type = pizza');
476
+ .search('', SearchQuery( filter: '_geoRadius(45.472735, 9.184019, 2000) AND type = pizza') );
481
477
geosearch_guide_sort_settings_1 : |-
482
478
await client.index('restaurants').updateSortableAttributes(['_geo']);
483
479
geosearch_guide_sort_usage_1 : |-
484
- await client.index('restaurants').search('', sort: ['_geoPoint(48.8561446, 2.2978204):asc']);
480
+ await client.index('restaurants').search('', SearchQuery( sort: ['_geoPoint(48.8561446, 2.2978204):asc']) );
485
481
geosearch_guide_sort_usage_2 : |-
486
- await client.index('restaurants').search('', sort: ['_geoPoint(48.8561446, 2.2978204):asc', 'rating:desc']);
482
+ await client.index('restaurants').search('', SearchQuery( sort: ['_geoPoint(48.8561446, 2.2978204):asc', 'rating:desc']) );
487
483
authorization_header_1 : |-
488
484
var client = MeiliSearchClient('http://localhost:7700', 'masterKey');
489
485
await client.getKeys();
@@ -559,12 +555,11 @@ landing_getting_started_1: |-
559
555
search_parameter_guide_crop_marker_1 : |-
560
556
await client
561
557
.index('movies')
562
- .search('shifu', attributesToCrop: ['overview'], cropMarker: "[…]");
558
+ .search('shifu', SearchQuery( attributesToCrop: ['overview'], cropMarker: "[…]") );
563
559
search_parameter_guide_highlight_tag_1 : |-
564
- await client
565
- .index('movies')
566
- .search('winter feast',
567
- attributesToHighlight: ['overview'],
568
- highlightPreTag: '<span class="highlight">',
569
- highlightPostTag: '</span>',
570
- );
560
+ await client.index('movies').search(
561
+ 'winter feast',
562
+ SearchQuery(
563
+ attributesToHighlight: ['overview'],
564
+ highlightPreTag: '<span class="highlight">',
565
+ highlightPostTag: '</span>'));
0 commit comments