This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
open-api.yaml
4585 lines (4533 loc) · 164 KB
/
open-api.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
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: Meilisearch Core API
description: 'Search documents, configure and manage the Meilisearch engine.'
version: 1.7.0
contact:
name: Meilisearch
email: bonjour@Meilisearch.com
license:
name: MIT
url: 'https://github.com/Meilisearch/Meilisearch/blob/main/LICENSE'
summary: 'An open source, blazingly fast and hyper relevant search-engine that will improve your search experience.'
servers:
- url: '{protocol}://{domain}:{port}'
variables:
protocol:
enum:
- https
- http
default: https
domain:
default: example.meilisearch.com
port:
default: '7700'
description: 'https://example.meilisearch.com:7700'
components:
schemas:
limit:
type: integer
description: Limit given for the query. If limit is not provided as a query parameter, this parameter displays the default limit value.
example: 10
offset:
type: integer
description: Offset given for the query. If offset is not provided as a query parameter, this parameter displays the default offset value.
example: 0
page:
type: integer
description: Sets the specific results page to fetch. If page is not provided as a query parameter, this parameter is ignored.
example: 1
hitsPerPage:
type: integer
description: Sets the number of results returned per page. If hitsPerPage is not provided as a query parameter, this parameter is ignored.
example: 20
totalHits:
type: integer
description: Returns the total number of search results. Computed if either `page` or `hitsPerPage` is provided as a query parameter.
example: 20
totalPages:
type: integer
description: Returns the total number of navigatable results pages for the search query. Computed if either `page` or `hitsPerPage` is provided as a query parameter.
example: 20
total:
type: integer
description: Total number of browsable results using offset/limit parameters for the given resource.
example: 50
from:
type: integer
description: The first task uid returned.
example: 999
next:
type: integer
description: Represents the value to send in `from` to fetch the next slice of the results. The first item for the next slice starts at this exact number. When the returned value is null, it means that all the data have been browsed in the given order.
example: 989
timestamp:
type: string
description: An `RFC 3339` format for date/time/duration.
example: '2019-11-20T09:40:33.711324Z'
index:
type: object
additionalProperties: false
examples:
- uid: movies
primaryKey: movie_id
createdAt: '2019-11-20T09:40:33.711324Z'
updatedAt: '2019-11-20T09:40:33.711324Z'
description: ''
title: ''
properties:
uid:
type: string
example: movies
description: Unique identifier for the index
primaryKey:
type:
- string
- 'null'
nullable: true
example: movie_id
description: Custom primaryKey for documents
createdAt:
$ref: '#/components/schemas/timestamp'
updatedAt:
$ref: '#/components/schemas/timestamp'
required:
- uid
- createdAt
- updatedAt
document:
type: object
additionalProperties: true
example:
id: 25684
title: American Ninja 5
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
overview: 'When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.'
release_date: 725846400
description: 'A document made of attribute. The maximum number of attribute for a document is 65,535.'
matchesPosition:
type: object
properties:
start:
type: integer
length:
type: integer
additionalProperties: false
required:
- start
- length
description: Starting position and length in bytes of the matched term in the returned value
order:
type: integer
description: The order that this ranking rule was applied
customRankingRuleDetails:
type: object
properties:
order:
$ref: '#/components/schemas/order'
value:
type:
- string
- number
- point
description: The value that was used for sorting this document
distance:
type: number
description: The distance between the target point and the geoPoint in the document
similarity:
type: number
description: |
the similarity score between the target vector and the value vector.
1.0 means a perfect similarity, 0.0 a perfect dissimilarity.
required:
- order
- value
description: Custom rule in the form of either `attribute:direction`, `vectorSort(vector)` or `_geoPoint(lat, lng):direction`.
score:
type: number
description: |
The relevancy score of a document according to a ranking rule and relative to a search query. Higher is better.
`1.0` indicates a perfect match, `0.0` no match at all (Meilisearch should not return documents that don't match the query).
rankingScoreDetails:
type: object
properties:
words:
type: object
properties:
order:
$ref: '#/components/schemas/order'
matchingWords:
type: integer
description: number of words in the query that match in the document. The higher the better.
maxMatchingWords:
type: integer
description: max number of words in the query that can match in the document for this iteration of the words ranking rule.
score:
$ref: '#/components/schemas/score'
required:
- order
- matchingWords
- maxMatchingWords
- score
typo:
type: object
properties:
order:
$ref: '#/components/schemas/order'
typoCount:
type: integer
description: The number of typos to correct in the query to match that document.
maxTypoCount:
type: integer
description: The maximum number of typos that can be corrected in the query to match a document.
score:
$ref: '#/components/schemas/score'
required:
- order
- typoCount
- maxTypoCount
- score
proximity:
type: object
properties:
order:
$ref: '#/components/schemas/order'
score:
$ref: '#/components/schemas/score'
required:
- order
- score
attribute:
type: object
properties:
order:
$ref: '#/components/schemas/order'
attributeRankingOrderScore:
type: number
description: |
Score computed depending on the first attribute each word of the query appears in.
The first attribute in the `searchableAttributes` list yields the highest score, the last attribute the lowest.
queryWordDistanceScore:
type: number
description: |
Score computed depending on the position the attributes where each word of the query appears in.
Words appearing in an attribute at the same position as in the query yield the highest score. The greater the distance to the position
in the query, the lower the score.
score:
$ref: '#/components/schemas/score'
required:
- order
- attributeRankingOrderScore
- queryWordDistanceScore
- score
exactness:
type: object
properties:
order:
$ref: '#/components/schemas/order'
matchType:
type: string
description: |
One of `exactMatch`, `matchesStart` or `noExactMatch`.
- `exactMatch`: the document contains an attribute that exactly matches the query.
- `matchesStart`: the document contains an attribute that exactly starts with the query.
- `noExactMatch`: any other document.
matchingWords:
type: integer
description: |
for `noExactMatch`, the number of exact words contained in an attribute. The higher the better.
maxMatchingWords:
type: integer
description: |
for `noExactMatch`, the maximum number of exact words contained in an attribute
score:
$ref: '#/components/schemas/score'
required:
- order
- matchType
- score
additionalProperties:
$ref: '#/components/schemas/customRankingRuleDetails'
description: The ranking score per ranking rule.
examples:
With sort:
words:
order: 0
matchingWords: 7
maxMatchingWords: 7
score: 1.0
"typo":
"order": 1
"typoCount": 0
"maxTypoCount": 0
"score": 1.0
"proximity":
"order": 2,
"score": 1.0
"attribute":
"order": 3
"attribute_ranking_order_score": 1.0
"query_word_distance_score": 1.0
"score": 1.0
"title:asc":
"order": 4
"value": "batman: the dark knight returns, part 1"
"release_date:desc":
"order": 5
"value": 1345507200.0
"exactness":
"order": 6
"matchType": "exactMatch"
"score": 1.0
hit:
type: object
additionalProperties: true
example:
id: 25684
title: American Ninja 5
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
overview: 'When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.'
release_date: 725846400
_formatted:
id: 25684
title: American Ninja 5
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
overview: 'When a scientists daughter is kidnapped, American <em>Ninja</em>, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the <em>ninja</em>.'
release_date: 725846400
_matchesPosition:
overview:
- start: 49
length: 5
- start: 155
length: 5
examples:
- id: 25684
title: American Ninja 5
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
overview: 'When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.'
release_date: 725846400
_formatted:
id: 25684
title: American Ninja 5
poster: 'https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg'
overview: 'When a scientists daughter is kidnapped, American <em>Ninja</em>, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the <em>ninja</em>.'
release_date: 725846400
_matchesPosition:
overview:
- start: 49
length: 5
- start: 155
length: 5
description: ''
properties:
_formatted:
type: object
description: Only present if `attributesToHighlight`/`attributesToCrop` is not empty. Return highlighted and cropped fields.
additionalProperties: true
_matchesPosition:
type: object
description: Only present if showMatchesPosition = `true`. Array of all search query occurrences in all fields.
properties:
'':
$ref: '#/components/schemas/matchesPosition'
_rankingScore:
type: number
description: Only present if showRankingScore = `true`. The ranking score of that document.
_rankingScoreDetails:
type: object
description: Only present if showRankingScoreDetails = `true`. The ranking score of each ranking rule for that document.
properties:
'':
$ref: '#/components/schemas/rankingScoreDetails'
attribute:
type:
- string
- number
description: Retrieve attributes of a search result. `attributesToRetrieve` controls these fields.
_geoDistance:
type: number
description: 'Using _geoPoint({lat}, {lng}) built-in sort rule at search leads the engine to return a _geoDistance within the search results. This field represents the distance in meters of the document from the specified _geoPoint.'
facetHit:
type: object
additionalProperties: true
examples:
- value: Romance
count: 25
description: FacetHit object represents a matched facet value for a facet search.
properties:
value:
type: string
description: The facet value being matched.
additionalProperties: true
count:
type: integer
description: The number of document containing the matched facet value.
documentId:
oneOf:
- type: number
- type: string
example: 468219
filter:
description: |
Attribute(s) to filter on.
Can be made of 3 syntaxes
- Nested Array: `["something > 1", "genres=comedy", ["genres=horror", "title=batman"]]`
- String: `"something > 1 AND genres=comedy AND (genres=horror OR title=batman)"`
- Mixed: `["something > 1 AND genres=comedy", "genres=horror OR title=batman"]`
> info
> _geoRadius({lat}, {lng}, {distance_in_meters}) and _geoBoundingBox([{lat, lng}], [{lat}, {lng}]) built-in filter rules can be used to filter documents within geo shapes.
> warn
> Attribute(s) used in `filter` should be declared as filterable attributes. See [Filtering and Faceted Search](https://docs.meilisearch.com/reference/features/filtering_and_faceted_search.html).
example:
- 'director:Mati Diop'
- - 'genres:Comedy'
- 'genres:Romance'
title: filter
oneOf:
- type: array
items:
type: string
pattern: '^[^:]+:[^:]+$'
- type: string
properties: {}
pattern: '^[^:]+:[^:]+$'
- type: array
items:
anyOf:
- type: array
items: {}
- type: string
sort:
description: |
Fields on which you want to sort the results.
> warn
> Attribute(s) used in `sort` should be declared as sortable attributes. See [Sorting](https://docs.meilisearch.com/reference/features/sorting.html).
> info
> _geoPoint({lat}, {long}) built-in sort rule can be used to sort documents around a geo point.
example:
- 'price:desc'
title: sort
oneOf:
- type: array
items:
type: string
searchResponse:
type: object
additionalProperties: false
title: ''
properties:
hits:
type: array
description: Array of documents matching the search.
items:
$ref: '#/components/schemas/hit'
offset:
type: integer
description: Number of documents skipped.
limit:
type: integer
description: Number of returned documents.
estimatedTotalHits:
type: integer
description: Estimated number of candidates for the search query.
page:
type: integer
description: The specific search results page to fetch.
hitsPerPage:
type: integer
description: Number of returned results per page.
totalHits:
type: integer
description: Exhaustive total number of search results for the search query.
totalPages:
type: integer
description: Number of navigatable results pages for the search query.
facetDistribution:
type: object
additionalProperties:
type: object
additionalProperties:
type: integer
description: |
[Distribution of the given facets](https://docs.meilisearch.com/reference/features/search_parameters.html#facet-distribution).
example:
genres:
action: 273
animation: 118
adventure: 132
fantasy: 67
comedy: 475
mystery: 70
thriller: 217
facetStats:
type: object
additionalProperties:
type: object
min:
type: number
description: The minimum value for the numerical facet being distributed.
max:
type: number
description: The maximum value for the numerical facet being distributed.
description: |
When using the facets parameter, the distributed facets that contain some numeric values are displayed in a facetStats object that contains, per facet, the numeric min and max values of the hits returned by the search query. If none of the hits returned by the search query have a numeric value for a facet, this facet is not part of the facetStats object.
example:
price:
min: 1
max: 4999.99
processingTimeMs:
type: integer
description: Processing time of the query.
query:
type: string
description: Query originating the response.
example: ninja
required:
- hits
- processingTimeMs
- query
facetSearchResponse:
type: object
additionalProperties: false
title: ''
properties:
facetHits:
type: array
description: Array of facet hits
items:
$ref: '#/components/schemas/facetHit'
facetQuery:
type: string
description: Facet query originating the response.
example: ninja
processingTimeMs:
type: integer
description: Processing time of the facet search query.
required:
- facetHits
- facetQuery
- processingTimeMs
task:
type: object
description: |
Meilisearch is an asynchronous API. It means that the API does not behave as you would typically expect when handling the request's responses.
Some operations are put in a queue and will be executed in turn (asynchronously). In this case, the server response contains the identifier to track the execution of the operation.
[Learn More](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html).
additionalProperties: false
examples:
- uid: 0
indexUid: movies
status: succeeded
type: documentAdditionOrUpdate
canceledBy: null
details:
receivedDocuments: 10
indexedDocuments: 10
duration: PT5S
enqueuedAt: '2021-01-01T09:39:00.000000Z'
startedAt: '2021-01-01T09:40:00.000000Z'
finishedAt: '2021-01-01T09:40:05.000000Z'
properties:
uid:
type: integer
description: The unique sequential identifier of the task
indexUid:
type: string
description: The unique identifier of the index where this task is operated
status:
type: string
description: The status of the task
enum:
- enqueued
- processing
- succeeded
- failed
example: succeeded
type:
type: string
description: The type of the task
enum:
- documentAdditionOrUpdate
- documentDeletion
- indexCreation
- indexUpdate
- indexDeletion
- indexSwap
- settingsUpdate
- dumpCreation
- taskCancelation
- taskDeletion
- snapshotCreation
canceledBy:
type: integer
description: The uid of the task that performed the taskCancelation if the task has been canceled.
details:
type: object
description: Details information of the task payload.
properties:
receivedDocuments:
type: integer
description: Number of documents received for documentAdditionOrUpdate task.
indexedDocuments:
type: integer
description: Number of documents finally indexed for documentAdditionOrUpdate task or a documentAdditionOrUpdate batch of tasks.
providedIds:
type: integer
description: Number of provided document ids for the documentDeletion task.
deletedDocuments:
type: integer
description: Number of documents finally deleted for documentDeletion and indexDeletion tasks.
primaryKey:
type: string
description: Value for the primaryKey field encountered if any for indexCreation or indexUpdate task.
settings:
$ref: '#/components/schemas/settings'
dumpUid:
type: string
description: Identifier generated for the dump for dumpCreation task.
matchedTasks:
type: integer
description: Number of tasks that match the request for taskCancelation or taskDeletion tasks.
canceledTasks:
type: integer
description: Number of tasks canceled for taskCancelation.
deletedTasks:
type: integer
description: Number of tasks deleted for taskDeletion.
originalFilter:
type: string
description: Original filter query for taskCancelation or taskDeletion tasks.
error:
description: Error object containing error details and context when a task has a failed status.
$ref: '#/components/schemas/error'
duration:
type: string
description: Total elasped time the engine was in processing state expressed as a `ISO-8601` duration format. Default is set to `null`
nullable: true
enqueuedAt:
description: Represent the date and time as a `RFC 3339` format when the task has been enqueued
$ref: '#/components/schemas/timestamp'
startedAt:
$ref: '#/components/schemas/timestamp'
description: Represent the date and time as a `RFC 3339` format when the task has been dequeued and started to be processed. Default is set to `null`
nullable: true
finishedAt:
$ref: '#/components/schemas/timestamp'
description: Represent the date and time as a `RFC 3339` format when the task has failed or succeeded. Default is set to `null`
nullable: true
required:
- uid
- indexUid
- status
- type
- canceledBy
- details
- error
- enqueuedAt
- startedAt
- finishedAt
summarizedTask:
type: object
description: A summarized version of an asynchronous task. Summarized task representation are given for the 202 Accepted HTTP response. [Learn More](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html).
additionalProperties: false
examples:
documentAdditionOrUpdate:
$ref: '#/components/examples/202_documentAdditionOrUpdate'
properties:
taskUid:
type: integer
description: The unique sequential identifier of the task. This `taskUid` allows you to [track the current task](https://docs.meilisearch.com/reference/api/tasks.html).
indexUid:
type: string
description: The unique identifier of the index where this task is operated
status:
type: string
description: The status of the task
enum:
- enqueued
type:
type: string
description: The type of the task
enum:
- documentAdditionOrUpdate
- documentDeletion
- indexCreation
- indexUpdate
- indexDeletion
- indexSwap
- settingsUpdate
- dumpCreation
- taskCancelation
- taskDeletion
enqueuedAt:
description: Represent the date and time as a `RFC 3339` format when the task has been enqueued
$ref: '#/components/schemas/timestamp'
required:
- uid
- indexUid
- status
- type
- enqueuedAt
synonyms:
type: object
description: List of associated words treated similarly. A word associated to an array of word as synonyms.
example:
wolverine:
- xmen
- logan
logan:
- wolverine
- xmen
wow:
- world of warcraft
stopWords:
type: array
description: List of words ignored when present in search queries.
items:
type: string
example:
- of
- the
- to
separatorTokens:
type: array
description: List of tokens that will be considered as word separators by Meilisearch.
items:
type: string
example:
- "&"
- "</br>"
- "@"
nonSeparatorTokens:
type: array
description: List of tokens that will not be considered as word separators by Meilisearch.
items:
type: string
example:
- "#"
- "-"
- "_"
dictionary:
type: array
description: List of words on which the segmentation will be overridden.
items:
type: string
example:
- J.K
- Dr.
- G/Box
sortableAttributes:
type: array
description: List of attributes to sort on at search.
items:
type: string
example:
- price
- author
- title
rankingRules:
type: array
description: |
List of ranking rules sorted by order of importance. The order is customizable.
[A list of ordered built-in ranking rules](https://docs.meilisearch.com/learn/core_concepts/relevancy.html).
items:
type: string
example:
- words
- typo
- proximity
- attribute
- sort
- exactness
- 'release_date:asc'
examples: []
typoTolerance:
type: object
description: Customize typo tolerance feature.
properties:
enabled:
description: Enable the typo tolerance feature.
type: boolean
default: true
nullable: false
disableOnAttributes:
description: Disable the typo tolerance feature on the specified attributes.
type: array
items:
type: string
default: []
nullable: false
disableOnWords:
description: Disable the typo tolerance feature for a set of query terms given for a search query.
type: array
items:
type: string
default: []
nullable: false
minWordSizeForTypos:
type: object
properties:
oneTypo:
description: Customize the minimum size for a word to tolerate 1 typo.
type: integer
default: 5
nullable: false
twoTypos:
description: Customize the minimum size for a word to tolerate 2 typos.
type: integer
default: 9
nullable: false
pagination:
type: object
description: Customize pagination settings
properties:
maxTotalHits:
description: Define the maximum number of documents reachable for a search request. It means that with the default value of `1000`, it is not possible to see the `1001`st result for a **search query**.
type: integer
default: 1000
nullable: false
faceting:
type: object
description: Customize faceting settings
properties:
maxValuesPerFacet:
description: Define maximum number of value returned for a facet for a **search query**. It means that with the default value of `100`, it is not possible to have `101` different colors if the `color`` field is defined as a facet at search time.
type: integer
default: 100
nullable: false
sortFacetValuesBy:
description: Defines how facet values are sorted. By default, all facets (`*`) are sorted by name, alphanumerically in ascending order (`alpha`). `count` sorts facet values by the number of documents containing a facet value in descending order.
type: object
example:
"*": 'alpha'
"genres": 'count'
filterableAttributes:
type: array
description: |
Attributes to use for faceting and filtering. See [Filtering and Faceted Search](https://docs.meilisearch.com/reference/features/filtering_and_faceted_search.html).
items:
type: string
example:
- genres
- director
title: filterableAttributes
distinctAttribute:
type: string
description: Search returns documents with distinct (different) values of the given field.
nullable: true
searchableAttributes:
type: array
description: Fields in which to search for matching query words sorted by order of importance.
items:
type: string
example:
- title
- description
- genre
displayedAttributes:
type: array
description: Fields displayed in the returned documents.
items:
type: string
example:
- title
- description
- genre
- release_date
settings:
type: object
description: |
[Learn more about the settings in this guide](https://docs.meilisearch.com/reference/features/settings.html).
additionalProperties: false
properties:
synonyms:
$ref: '#/components/schemas/synonyms'
stopWords:
$ref: '#/components/schemas/stopWords'
rankingRules:
$ref: '#/components/schemas/rankingRules'
filterableAttributes:
$ref: '#/components/schemas/filterableAttributes'
distinctAttribute:
$ref: '#/components/schemas/distinctAttribute'
searchableAttributes:
$ref: '#/components/schemas/searchableAttributes'
displayedAttributes:
$ref: '#/components/schemas/displayedAttributes'
typoTolerance:
$ref: '#/components/schemas/typoTolerance'
required:
- synonyms
- stopWords
- rankingRules
- filterableAttributes
- distinctAttribute
- searchableAttributes
- displayedAttributes
- typoTolerance
stats:
type: object
additionalProperties: false
title: ''
examples:
- numberOfDocuments: 10
isIndexing: true
fieldDistribution:
genre: 10
author: 9
properties:
numberOfDocuments:
type: integer
description: Number of documents contained in the index.
isIndexing:
type: boolean
description: Whether or not the index is currently ingesting document
fieldDistribution:
type: object
additionalProperties:
type: integer
description: How many documents contains a field
required:
- numberOfDocuments
- isIndexing
- fieldDistribution
searchQuery:
type: object
additionalProperties: false
properties:
q:
type: string
description: Query string.
default: '""'
example: '"Back to the future"'
vector:
type: array
description: Query vector.
default: 'null'
example: '[0.8, 0.145, 0.26, 0.3]'
attributesToRetrieve:
type: array
description: 'Array of attributes whose fields will be present in the returned documents. Defaults to the [displayedAttributes list](https://docs.meilisearch.com/reference/features/settings.html#displayed-attributes) which contains by default all attributes found in the documents.'
items:
type: string
example: '["title", "overview"]'
default: '["*"]'
attributesToHighlight:
type: array
description: Array of attributes whose values will contain highlighted matching terms. Highlighted attributes are returned in `_formatted` response object.
items:
type: string
example: '["title", "overview"]'
default: '[]'
highlightPreTag:
type: string
description: Specify the tag to put before the highlighted query terms.
example: '<mark>'
default: '<em>'
highlightPostTag:
type: string
description: Specify the tag to put after the highlighted query terms.
example: '</mark>'
default: '</em>'
attributesToCrop:
type: array
description: Array of attributes whose values have to be cropped. Cropped attributes are returned in `_formatted` response object.
items:
type: string
example: '["overview", "author"]'
default: '[]'
cropMarker:
type: string
description: Sets the crop marker to apply before and/or after cropped part selected within an attribute defined in `attributesToCrop` parameter.
default: '…'
cropLength:
type: number
description: Sets the total number of **words** to keep for the cropped part of an attribute specified in the `attributesToCrop` parameter.
default: 10
showMatchesPosition:
type: boolean
description: Defines whether an `_matchesPosition` object that contains information about the matches should be returned or not.
default: false
showRankingScore:
type: boolean
description: Defines whether a `_rankingScore` number representing the relevancy score of that document should be returned or not.
default: false
showRankingScoreDetails:
type: boolean
description: Defines whether a `_rankingScoreDetails` object containing information about the score of that document for each ranking rule should be returned or not.
default: false
matchingStrategy:
type: string
description: Defines which strategy to use to match the query terms within the documents as search results. Two different strategies are available, `last` and `all`. By default, the `last` strategy is chosen.
default: 'last'
attributesToSearchOn:
type: array
description: Defines which `searchableAttributes` the query will search on.
default: '["*"]'
filter:
$ref: '#/components/schemas/filter'
facets:
type: array
description: 'Array of attributes whose fields will be distributed as a facet. If you have [set up filterableAttributes](https://docs.meilisearch.com/reference/features/settings.html#filterable-attributes), you can retrieve the count of matching terms for each [facets](https://docs.meilisearch.com/reference/features/filtering_and_faceted_search.html#faceted-search).[Learn more about facet distribution in the dedicated guide](https://docs.meilisearch.com/reference/features/search_parameters.html#facet-distribution)'
items:
type: string
example: '["genres", "author"]'
default: '[]'
offset:
type: number
description: Number of documents to skip.
default: 0
limit:
type: number
description: Maximum number of documents returned.
default: 20
page:
type: number
description: The specific search results page to fetch.
example: 1