-
Notifications
You must be signed in to change notification settings - Fork 46
/
.code-samples.meilisearch.yaml
675 lines (663 loc) · 21.7 KB
/
.code-samples.meilisearch.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
# This code-samples file is used by the Meilisearch documentation
# Every example written here will be automatically fetched by
# the documentation on build
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
---
get_documents_post_1: |-
client.index('books').get_documents(
filter: '(rating > 3 AND (genres = Adventure OR genres = Fiction)) AND language = English',
limit: 3,
fields: ['title', 'genres', 'rating', 'language']
)
delete_documents_by_filter_1: |-
client.index('movies').delete_documents(filter: 'genres = action OR genres = adventure')
get_documents_1: |-
client.index('movies').get_documents(limit: 2, filter: 'genres = action')
getting_started_faceting: |-
client.index('movies').update_faceting({
max_values_per_facet: 2,
sort_facet_values_by: {
genres: 'count'
}
})
getting_started_pagination: |-
client.index('movies').update_pagination(max_total_hits: 500)
synonyms_guide_1: |-
client.index('movies').update_synonyms({
great: ['fantastic'],
fantastic: ['great']
})
date_guide_index_1: |-
require 'json'
games = JSON.parse(File.read('games.json'))
client.index('games').add_documents(games)
date_guide_filterable_attributes_1: |-
client.index('games').update_filterable_attributes(['release_timestamp'])
date_guide_filter_1: |-
client.index('games').search('', {
filter: 'release_timestamp >= 1514761200 AND release_timestamp < 1672527600'
})
date_guide_sortable_attributes_1: |-
client.index('games').update_sortable_attributes(['release_timestamp'])
date_guide_sort_1: |-
client.index('games').search('', sort: ['release_timestamp:desc'])
async_guide_filter_by_date_1: |-
client.get_tasks(after_enqueued_at: DateTime.new(2020, 10, 11, 11, 49, 53))
async_guide_multiple_filters_1: |-
client.get_tasks(index_uids: ['movies'], types: ['documentAdditionOrUpdate', 'documentDeletion'], statuses: ['processing'])
async_guide_filter_by_ids_1: |-
client.get_tasks(uids: [5, 10, 13])
async_guide_filter_by_statuses_1: |-
client.get_tasks(statuses: ['failed', 'canceled'])
async_guide_filter_by_types_1: |-
client.get_tasks(types: ['dumpCreation', 'indexSwap'])
async_guide_filter_by_index_uids_1: |-
client.get_tasks(index_uids: ['movies'])
delete_tasks_1: |-
client.delete_tasks(uids: [1, 2])
cancel_tasks_1: |-
client.cancel_tasks(uids: [1, 2])
async_guide_canceled_by_1: |-
client.get_tasks(canceled_by: [9, 15])
swap_indexes_1: |-
client.swap_indexes(['indexA', 'indexB'], ['indexX', 'indexY'])
search_parameter_guide_hitsperpage_1: |-
client.index('movies').search('', hits_per_page: 15)
search_parameter_guide_page_1: |-
client.index('movies').search('', page: 2)
getting_started_typo_tolerance: |-
client.index('movies').update_typo_tolerance({ min_word_size_for_typos: { one_typo: 4 } })
get_all_tasks_paginating_1: |-
client.tasks(limit: 2, from: 10)
get_all_tasks_paginating_2: |-
client.tasks(limit: 2, from: 8)
get_pagination_settings_1: |-
index('books').pagination
update_pagination_settings_1: |-
index('books').update_pagination({ max_total_hits: 100 })
reset_pagination_settings_1: |-
index('books').reset_pagination
get_faceting_settings_1: |-
client.index('books').faceting
update_faceting_settings_1: |-
client.index('books').update_faceting({
max_values_per_facet: 2,
sort_facet_values_by: {
'*': 'alpha',
genres: 'count'
}
})
reset_faceting_settings_1: |-
index('books').reset_faceting
get_one_index_1: |-
client.fetch_index('movies')
list_all_indexes_1: |-
client.indexes(limit: 3)
create_an_index_1: |-
client.create_index('movies', primary_key: 'id')
primary_field_guide_create_index_primary_key: |-
client.create_index('books', primary_key: 'reference_number')
primary_field_guide_update_document_primary_key: |-
client.index('books').update(primary_key: 'title')
update_an_index_1: |-
client.index('movies').update(primary_key: 'movie_id')
delete_an_index_1: |-
client.delete_index('movies')
get_one_document_1: |-
client.index('movies').document(25684, fields: ['id', 'title', 'poster', 'release_date'])
primary_field_guide_add_document_primary_key: |-
client.index('books').add_documents([
{
reference_number: 287947,
title: 'Diary of a Wimpy Kid',
author: 'Jeff Kinney',
genres: ['comedy', 'humor'],
price: 5.00
}
], 'reference_number')
add_or_replace_documents_1: |-
client.index('movies').add_documents([
{
id: 287947,
title: 'Shazam',
poster: 'https://image.tmdb.org/t/p/w1280/xnopI5Xtky18MPhK40cZAGAOVeV.jpg',
overview: 'A boy is given the ability to become an adult superhero in times of need with a single magic word.',
release_date: '2019-03-23'
}
])
add_or_update_documents_1: |-
client.index('movies').update_documents([
{
id: 287947,
title: 'Shazam ⚡️',
genres: 'comedy'
}
])
delete_all_documents_1: |-
client.index('movies').delete_all_documents
delete_one_document_1: |-
client.index('movies').delete_document(25684)
delete_documents_by_batch_1: |-
client.index('movies').delete_documents([23488, 153738, 437035, 363869])
search_post_1: |-
client.index('movies').search('american ninja')
get_task_1: |-
client.task(1)
get_all_tasks_1: |-
client.tasks
get_settings_1: |-
client.index('movies').settings
update_settings_1: |-
client.index('movies').update_settings({
ranking_rules: [
'words',
'typo',
'proximity',
'attribute',
'sort',
'exactness',
'release_date:desc',
'rank:desc'
],
distinct_attribute: 'movie_id',
searchable_attributes: [
'title',
'overview',
'genres'
],
displayed_attributes: [
'title',
'overview',
'genres',
'release_date'
],
stop_words: [
'the',
'a',
'an'
],
sortable_attributes: [
'title',
'release_date'
],
synonyms: {
wolverine: ['xmen', 'logan'],
logan: ['wolverine']
},
pagination: {
max_total_hits: 5000
},
faceting: {
max_values_per_facet: 200
},
search_cutoff_ms: 150
})
reset_settings_1: |-
client.index('movies').reset_settings
get_synonyms_1: |-
client.index('movies').synonyms
update_synonyms_1: |-
client.index('movies').update_synonyms({
wolverine: ['xmen', 'logan'],
logan: ['wolverine', 'xmen'],
wow: ['world of warcraft']
})
reset_synonyms_1: |-
client.index('movies').reset_synonyms
get_stop_words_1: |-
client.index('movies').stop_words
update_stop_words_1: |-
client.index('movies').update_stop_words(['of', 'the', 'to'])
reset_stop_words_1: |-
client.index('movies').reset_stop_words
get_ranking_rules_1: |-
client.index('movies').ranking_rules
update_ranking_rules_1: |-
client.index('movies').update_ranking_rules([
'words',
'typo',
'proximity',
'attribute',
'sort',
'exactness',
'release_date:asc',
'rank:desc'
])
reset_ranking_rules_1: |-
client.index('movies').reset_ranking_rules
get_distinct_attribute_1: |-
client.index('shoes').distinct_attribute
update_distinct_attribute_1: |-
client.index('shoes').update_distinct_attribute('skuid')
reset_distinct_attribute_1: |-
client.index('shoes').reset_distinct_attribute
get_searchable_attributes_1: |-
client.index('movies').searchable_attributes
update_searchable_attributes_1: |-
client.index('movies').update_searchable_attributes([
'title',
'overview',
'genres'
])
reset_searchable_attributes_1: |-
client.index('movies').reset_searchable_attributes
get_filterable_attributes_1: |-
client.index('movies').filterable_attributes
update_filterable_attributes_1: |-
client.index('movies').update_filterable_attributes([
'genres',
'director'
])
reset_filterable_attributes_1: |-
client.index('movies').reset_filterable_attributes
get_displayed_attributes_1: |-
client.index('movies').get_displayed_attributes
update_displayed_attributes_1: |-
client.index('movies').update_displayed_attributes([
'title',
'overview',
'genres',
'release_date'
])
reset_displayed_attributes_1: |-
client.index('movies').reset_displayed_attributes
get_index_stats_1: |-
client.index('movies').stats
get_indexes_stats_1: |-
client.stats
get_health_1: |-
client.health
get_version_1: |-
client.version
distinct_attribute_guide_1: |-
client.index('jackets').update_distinct_attribute('product_id')
field_properties_guide_searchable_1: |-
client.index('movies').update_searchable_attributes([
'title',
'overview',
'genres'
])
field_properties_guide_displayed_1: |-
client.index('movies').update_settings({
displayed_attributes: [
'title',
'overview',
'genres',
'release_date'
]
})
filtering_guide_1: |-
client.index('movie_ratings').search('Avengers', { filter: 'release_date > 795484800' })
filtering_guide_2: |-
client.index('movie_ratings').search('Batman', {
filter: 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")'
})
filtering_guide_3: |-
client.index('movie_ratings').search('Planet of the Apes', {
filter: "release_date > 1577884550 AND (NOT director = \"Tim Burton\")"
})
filtering_guide_nested_1: |-
client.index('movies_ratings').search('thriller', {
filter: 'rating.users >= 90'
})
search_parameter_guide_query_1: |-
client.index('movies').search('shifu')
search_parameter_guide_offset_1: |-
client.index('movies').search('shifu', {
offset: 1
})
search_parameter_guide_limit_1: |-
client.index('movies').search('shifu', {
limit: 2
})
search_parameter_guide_retrieve_1: |-
client.index('movies').search('shifu', {
attributes_to_retrieve: ['overview', 'title']
})
search_parameter_guide_crop_1: |-
client.index('movies').search('shifu', {
attributes_to_crop: ['overview'],
crop_length: 5
})
search_parameter_guide_crop_marker_1: |-
client.index('movies').search('shifu', {
attributes_to_crop: ['overview'],
crop_marker: '[…]'
})
search_parameter_guide_highlight_1: |-
client.index('movies').search('winter feast', {
attributes_to_highlight: ['overview']
})
search_parameter_guide_highlight_tag_1: |-
client.index('movies').search('winter feast', {
attributes_to_highlight: ['overview'],
highlight_pre_tag: '<span class="highlight">',
highlight_post_tag: '</span>'
})
search_parameter_guide_show_matches_position_1: |-
client.index('movies').search('winter feast', {
show_matches_position: true
})
search_parameter_guide_matching_strategy_1: |-
client.index('movies').search('big fat liar', {
matching_strategy: 'last'
})
search_parameter_guide_matching_strategy_2: |-
client.index('movies').search('big fat liar', {
matching_strategy: 'all'
})
search_parameter_guide_matching_strategy_3: |-
client.index('movies').search('white shirt', {
matching_strategy: 'frequency'
})
search_parameter_guide_show_ranking_score_1: |-
client.index('movies').search('dragon', {
show_ranking_score: true
})
search_parameter_guide_show_ranking_score_details_1: |-
client.index('movies').search('dragon', {
show_ranking_score_details: true
})
search_parameter_guide_attributes_to_search_on_1: |-
client.index('movies').search('adventure', {
attributes_to_search_on: ['overview']
})
add_movies_json_1: |-
require 'json'
movies_json = File.read('movies.json')
movies = JSON.parse(movies_json)
client.index('movies').add_documents(movies)
getting_started_add_documents_md: |-
```bash
$ bundle add meilisearch
```
```ruby
require 'json'
require 'meilisearch'
client = MeiliSearch::Client.new('http://localhost:7700', 'aSampleMasterKey')
movies_json = File.read('movies.json')
movies = JSON.parse(movies_json)
client.index('movies').add_documents(movies)
```
[About this SDK](https://www.github.com/meilisearch/meilisearch-ruby)
getting_started_search_md: |-
```ruby
client.index('movies').search('botman')
```
[About this SDK](https://www.github.com/meilisearch/meilisearch-ruby)
filtering_update_settings_1: |-
client.index('movies').update_filterable_attributes([
'director',
'genres'
])
faceted_search_1: |-
client.index('books').search('classic', {
facets: ['genres', 'rating', 'language']
})
faceted_search_walkthrough_filter_1: |-
client.index('movies').search('thriller', {
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
})
faceted_search_update_settings_1: |-
client.index('movie_ratings').update_filterable_attributes(['genres', 'rating', 'language'])
post_dump_1: |-
client.create_dump
create_snapshot_1: |-
client.create_snapshot
phrase_search_1: |-
client.index('movies').search('"african american" horror')
sorting_guide_update_sortable_attributes_1: |-
client.index('books').update_sortable_attributes(['author', 'price'])
sorting_guide_update_ranking_rules_1: |-
client.index('books').update_ranking_rules([
'words',
'sort',
'typo',
'proximity',
'attribute',
'exactness'
])
sorting_guide_sort_parameter_1: |-
client.index('books').search('science fiction', { sort: ['price:asc'] })
sorting_guide_sort_parameter_2: |-
client.index('books').search('butler', { sort: ['author:desc'] })
get_sortable_attributes_1: |-
client.index('books').sortable_attributes
update_sortable_attributes_1: |-
client.index('books').update_sortable_attributes([
'price',
'author'
])
sorting_guide_sort_nested_1: |-
client.index('books').search('science fiction', { sort: ['rating.users:asc'] })
reset_sortable_attributes_1: |-
client.index('books').reset_sortable_attributes
search_parameter_guide_sort_1: |-
client.index('books').search('science fiction', { sort: ['price:asc'] })
geosearch_guide_filter_settings_1: |-
client.index('restaurants').update_filterable_attributes(['_geo'])
geosearch_guide_filter_usage_1: |-
client.index('restaurants').search('', { filter: '_geoRadius(45.472735, 9.184019, 2000)' })
geosearch_guide_filter_usage_2: |-
client.index('restaurants').search('', { filter: '_geoRadius(45.472735, 9.184019, 2000) AND type = pizza' })
geosearch_guide_filter_usage_3: |-
client.index('restaurants').search('', { filter: ['_geoBoundingBox([45.494181, 9.214024], [45.449484, 9.179175])'] })
geosearch_guide_sort_settings_1: |-
client.index('restaurants').update_sortable_attributes(['_geo'])
geosearch_guide_sort_usage_1: |-
client.index('restaurants').search('', { sort: ['_geoPoint(48.8561446, 2.2978204):asc'] })
geosearch_guide_sort_usage_2: |-
client.index('restaurants').search('', { sort: ['_geoPoint(48.8561446, 2.2978204):asc', 'rating:desc'] })
authorization_header_1: |-
client = MeiliSearch::Client.new('http://localhost:7700', 'masterKey')
client.keys
get_one_key_1: |-
client.key('6062abda-a5aa-4414-ac91-ecd7944c0f8d')
get_all_keys_1: |-
client.keys(limit: 3)
create_a_key_1: |-
client.create_key(
description: 'Add documents: Products API key',
actions: ['documents.add'],
indexes: ['products'],
expires_at: '2042-04-02T00:42:42Z'
)
update_a_key_1: |-
client.update_key(
'6062abda-a5aa-4414-ac91-ecd7944c0f8d',
{
description: 'Manage documents: Products/Reviews API key',
name: 'Products/Reviews API key'
}
)
delete_a_key_1: |-
client.delete_key('6062abda-a5aa-4414-ac91-ecd7944c0f8d')
security_guide_search_key_1: |-
client = MeiliSearch::Client.new('http://localhost:7700', 'apiKey')
client.index('patient_medical_records').search
security_guide_update_key_1: |-
client = MeiliSearch::Client.new('http://localhost:7700', 'masterKey')
client.update_key('74c9c733-3368-4738-bbe5-1d18a5fecb37', description: 'Default Search API Key')
security_guide_create_key_1: |-
client = MeiliSearch::Client.new('http://localhost:7700', 'masterKey')
client.create_key(
description: 'Search patient records key',
actions: ['search'],
indexes: ['patient_medical_records'],
expires_at: '2023-01-01T00:00:00Z'
)
security_guide_list_keys_1: |-
client = MeiliSearch::Client.new('http://localhost:7700', 'masterKey')
client.keys
security_guide_delete_key_1: |-
client = MeiliSearch::Client.new('http://localhost:7700', 'masterKey')
client.delete_key('ac5cd97d-5a4b-4226-a868-2d0eb6d197ab')
tenant_token_guide_generate_sdk_1: |-
uid = '85c3c2f9-bdd6-41f1-abd8-11fcf80e0f76'
api_key = 'B5KdX2MY2jV6EXfUs6scSfmC...'
expires_at = Time.new(2025, 12, 20).utc
search_rules = {
'patient_medical_records' => {
'filter' => 'user_id = 1'
}
}
token = client.generate_tenant_token(uid, search_rules, api_key: api_key, expires_at: expires_at)
tenant_token_guide_search_sdk_1: |-
front_end_client = MeiliSearch::Client.new('http://localhost:7700', token)
front_end_client.index('patient_medical_records').search('blood test')
getting_started_update_ranking_rules: |-
client.index('movies').update_ranking_rules([
'exactness',
'words',
'typo',
'proximity',
'attribute',
'sort',
'release_date:asc',
'rank:desc'
])
getting_started_update_searchable_attributes: |-
client.index('movies').update_searchable_attributes([
'title'
])
getting_started_update_stop_words: |-
client.index('movies').update_stop_words(['the'])
getting_started_check_task_status: |-
client.task(0)
getting_started_synonyms: |-
client.index('movies').update_synonyms({
winnie: ['piglet'],
piglet: ['winnie']
})
getting_started_update_displayed_attributes: |-
client.index('movies').update_displayed_attributes([
'title',
'overview',
'poster'
])
getting_started_add_meteorites: |-
file = File.read('meteorites.json')
json = JSON.parse(file)
client.index('meteorites').add_documents(json)
getting_started_configure_settings: |-
client.index('meteorites').update_settings({
filterable_attributes: ['mass', '_geo'],
sortable_attributes: ['mass', '_geo']
})
getting_started_geo_radius: |-
client.index('meteorites').search('', { filter: '_geoRadius(46.9480, 7.4474, 210000)' })
getting_started_geo_point: |-
client.index('meteorites').search('', { sort: ['_geoPoint(48.8583701, 2.2922926):asc'] })
getting_started_sorting: |-
client.index('meteorites').search('', {
sort: ['mass:asc'],
filter: 'mass < 200'
})
getting_started_filtering: |-
client.index('meteorites').search('', { filter: 'mass < 200' })
landing_getting_started_1: |-
client = MeiliSearch::Client.new('http://localhost:7700', 'masterKey')
client.index('movies').add_documents([
{ id: 1, title: 'Carol' },
{ id: 2, title: 'Wonder Woman' },
{ id: 3, title: 'Life of Pi' },
{ id: 4, title: 'Mad Max: Fury Road' },
{ id: 5, title: 'Moana' },
{ id: 6, title: 'Philadelphia' }
])
get_typo_tolerance_1: |-
index('books').typo_tolerance
update_typo_tolerance_1: |-
index('books').update_typo_tolerance({
min_word_size_for_typos: {
one_typo: 4,
two_typos: 10
},
disable_on_attributes: ['title']
})
reset_typo_tolerance_1: |-
index('books').reset_typo_tolerance
typo_tolerance_guide_1: |-
index('books').update_typo_tolerance({ enabled: false })
typo_tolerance_guide_2: |-
index('books').update_typo_tolerance({ disable_on_attributes: ['title'] })
typo_tolerance_guide_3: |-
index('books').update_typo_tolerance({ disable_on_words: ['shrek'] })
typo_tolerance_guide_4: |-
index('books').update_typo_tolerance({
min_word_size_for_typos: {
one_typo: 4,
two_typos: 10
}
})
search_parameter_guide_facet_stats_1: |-
client.index('movie_ratings').search('Batman', {
facets: ['genres', 'rating']
})
multi_search_1: |-
client.multi_search([
{ index_uid: 'books', q: 'prince' },
{ index_uid: 'movies', q: 'pooh', limit: 5 }
{ index_uid: 'movies', q: 'nemo', limit: 5 }
{ index_uid: 'movie_ratings', q: 'us' }
])
facet_search_1: |-
client.index('books').facet_search('genres', 'fiction', filter: 'rating > 3')
facet_search_2: |-
client.index('books').update_faceting(
sort_facet_values_by: {
genres: 'count'
}
)
facet_search_3: |-
client.index('books').facet_search('genres', 'c')
get_dictionary_1: |-
client.index('books').dictionary
update_dictionary_1: |-
client.index('books').update_dictionary(['J. R. R.', 'W. E. B.'])
reset_dictionary_1: |-
client.index('books').reset_dictionary
get_separator_tokens_1: |-
client.index('articles').separator_tokens
update_separator_tokens_1: |-
client.index('articles').update_separator_tokens(['|', '…'])
reset_separator_tokens_1: |-
client.index('articles').reset_separator_tokens
get_non_separator_tokens_1: |-
client.index('articles').non_separator_tokens
update_non_separator_tokens_1: |-
client.index('articles').update_non_separator_tokens(['@', '#'])
reset_non_separator_tokens_1: |-
client.index('articles').reset_non_separator_tokens
get_proximity_precision_settings_1: |-
client.index('books').proximity_precision
update_proximity_precision_settings_1: |-
client.index('books').update_proximity_precision('byAttribute')
reset_proximity_precision_settings_1: |-
client.index('books').reset_proximity_precision
get_search_cutoff_1: |-
client.index('movies').search_cutoff_ms
update_search_cutoff_1: |-
client.index('movies').update_search_cutoff_ms(150)
reset_search_cutoff_1: |-
client.index('movies').reset_search_cutoff_ms
get_similar_post_1: |-
client.index('INDEX_NAME').search_similar_documents('TARGET_DOCUMENT_ID', embedder: 'default')
search_parameter_reference_ranking_score_threshold_1: |-
client.index('INDEX_NAME').search('badman', {
rankingScoreThreshold: 0.2
})
search_parameter_reference_distinct_1: |-
client.index('INDEX_NAME').search('QUERY TERMS', {
distinct: 'ATTRIBUTE_A'
})
distinct_attribute_guide_filterable_1: |-
client.index('products').update_filterable_attributes([
'product_id',
'sku',
'url'
])
distinct_attribute_guide_distinct_parameter_1: |-
client.index('products').search('white shirt', {
distinct: 'sku'
})