-
Notifications
You must be signed in to change notification settings - Fork 87
/
types.go
610 lines (537 loc) · 24 KB
/
types.go
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
package meilisearch
import (
"time"
"github.com/golang-jwt/jwt/v4"
)
type (
ContentEncoding string
EncodingCompressionLevel int
)
const (
DefaultLimit int64 = 20
contentTypeJSON string = "application/json"
contentTypeNDJSON string = "application/x-ndjson"
contentTypeCSV string = "text/csv"
GzipEncoding ContentEncoding = "gzip"
DeflateEncoding ContentEncoding = "deflate"
BrotliEncoding ContentEncoding = "br"
NoCompression EncodingCompressionLevel = 0
BestSpeed EncodingCompressionLevel = 1
BestCompression EncodingCompressionLevel = 9
DefaultCompression EncodingCompressionLevel = -1
HuffmanOnlyCompression EncodingCompressionLevel = -2
ConstantCompression EncodingCompressionLevel = -2
StatelessCompression EncodingCompressionLevel = -3
nullBody = "null"
)
func (c ContentEncoding) String() string { return string(c) }
func (c ContentEncoding) IsZero() bool { return c == "" }
func (c EncodingCompressionLevel) Int() int { return int(c) }
type IndexConfig struct {
// Uid is the unique identifier of a given index.
Uid string
// PrimaryKey is optional
PrimaryKey string
}
type IndexResult struct {
UID string `json:"uid"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
PrimaryKey string `json:"primaryKey,omitempty"`
IndexManager
}
// IndexesResults return of multiple indexes is wrap in a IndexesResults
type IndexesResults struct {
Results []*IndexResult `json:"results"`
Offset int64 `json:"offset"`
Limit int64 `json:"limit"`
Total int64 `json:"total"`
}
type IndexesQuery struct {
Limit int64
Offset int64
}
// Settings is the type that represents the settings in meilisearch
type Settings struct {
RankingRules []string `json:"rankingRules,omitempty"`
DistinctAttribute *string `json:"distinctAttribute,omitempty"`
SearchableAttributes []string `json:"searchableAttributes,omitempty"`
Dictionary []string `json:"dictionary,omitempty"`
SearchCutoffMs int64 `json:"searchCutoffMs,omitempty"`
ProximityPrecision ProximityPrecisionType `json:"proximityPrecision,omitempty"`
SeparatorTokens []string `json:"separatorTokens,omitempty"`
NonSeparatorTokens []string `json:"nonSeparatorTokens,omitempty"`
DisplayedAttributes []string `json:"displayedAttributes,omitempty"`
StopWords []string `json:"stopWords,omitempty"`
Synonyms map[string][]string `json:"synonyms,omitempty"`
FilterableAttributes []string `json:"filterableAttributes,omitempty"`
SortableAttributes []string `json:"sortableAttributes,omitempty"`
LocalizedAttributes []*LocalizedAttributes `json:"localizedAttributes,omitempty"`
TypoTolerance *TypoTolerance `json:"typoTolerance,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
Faceting *Faceting `json:"faceting,omitempty"`
Embedders map[string]Embedder `json:"embedders,omitempty"`
}
type LocalizedAttributes struct {
Locales []string `json:"locales,omitempty"`
AttributePatterns []string `json:"attributePatterns,omitempty"`
}
// TypoTolerance is the type that represents the typo tolerance setting in meilisearch
type TypoTolerance struct {
Enabled bool `json:"enabled"`
MinWordSizeForTypos MinWordSizeForTypos `json:"minWordSizeForTypos,omitempty"`
DisableOnWords []string `json:"disableOnWords,omitempty"`
DisableOnAttributes []string `json:"disableOnAttributes,omitempty"`
}
// MinWordSizeForTypos is the type that represents the minWordSizeForTypos setting in the typo tolerance setting in meilisearch
type MinWordSizeForTypos struct {
OneTypo int64 `json:"oneTypo,omitempty"`
TwoTypos int64 `json:"twoTypos,omitempty"`
}
// Pagination is the type that represents the pagination setting in meilisearch
type Pagination struct {
MaxTotalHits int64 `json:"maxTotalHits"`
}
// Faceting is the type that represents the faceting setting in meilisearch
type Faceting struct {
MaxValuesPerFacet int64 `json:"maxValuesPerFacet"`
// SortFacetValuesBy index_name: alpha|count
SortFacetValuesBy map[string]SortFacetType `json:"sortFacetValuesBy"`
}
type Embedder struct {
Source string `json:"source"`
URL string `json:"url,omitempty"`
ApiKey string `json:"apiKey,omitempty"`
Model string `json:"model,omitempty"`
Dimensions int `json:"dimensions,omitempty"`
DocumentTemplate string `json:"documentTemplate,omitempty"`
}
// Version is the type that represents the versions in meilisearch
type Version struct {
CommitSha string `json:"commitSha"`
CommitDate string `json:"commitDate"`
PkgVersion string `json:"pkgVersion"`
}
// StatsIndex is the type that represent the stats of an index in meilisearch
type StatsIndex struct {
NumberOfDocuments int64 `json:"numberOfDocuments"`
IsIndexing bool `json:"isIndexing"`
FieldDistribution map[string]int64 `json:"fieldDistribution"`
}
// Stats is the type that represent all stats
type Stats struct {
DatabaseSize int64 `json:"databaseSize"`
LastUpdate time.Time `json:"lastUpdate"`
Indexes map[string]StatsIndex `json:"indexes"`
}
type (
TaskType string // TaskType is the type of a task
SortFacetType string // SortFacetType is type of facet sorting, alpha or count
TaskStatus string // TaskStatus is the status of a task.
ProximityPrecisionType string // ProximityPrecisionType accepts one of the ByWord or ByAttribute
MatchingStrategy string // MatchingStrategy one of the Last, All, Frequency
)
const (
// Last returns documents containing all the query terms first. If there are not enough results containing all
// query terms to meet the requested limit, Meilisearch will remove one query term at a time,
// starting from the end of the query.
Last MatchingStrategy = "last"
// All only returns documents that contain all query terms. Meilisearch will not match any more documents even
// if there aren't enough to meet the requested limit.
All MatchingStrategy = "all"
// Frequency returns documents containing all the query terms first. If there are not enough results containing
//all query terms to meet the requested limit, Meilisearch will remove one query term at a time, starting
//with the word that is the most frequent in the dataset. frequency effectively gives more weight to terms
//that appear less frequently in a set of results.
Frequency MatchingStrategy = "frequency"
)
const (
// ByWord calculate the precise distance between query terms. Higher precision, but may lead to longer
// indexing time. This is the default setting
ByWord ProximityPrecisionType = "byWord"
// ByAttribute determine if multiple query terms are present in the same attribute.
// Lower precision, but shorter indexing time
ByAttribute ProximityPrecisionType = "byAttribute"
)
const (
// TaskStatusUnknown is the default TaskStatus, should not exist
TaskStatusUnknown TaskStatus = "unknown"
// TaskStatusEnqueued the task request has been received and will be processed soon
TaskStatusEnqueued TaskStatus = "enqueued"
// TaskStatusProcessing the task is being processed
TaskStatusProcessing TaskStatus = "processing"
// TaskStatusSucceeded the task has been successfully processed
TaskStatusSucceeded TaskStatus = "succeeded"
// TaskStatusFailed a failure occurred when processing the task, no changes were made to the database
TaskStatusFailed TaskStatus = "failed"
// TaskStatusCanceled the task was canceled
TaskStatusCanceled TaskStatus = "canceled"
)
const (
SortFacetTypeAlpha SortFacetType = "alpha"
SortFacetTypeCount SortFacetType = "count"
)
const (
// TaskTypeIndexCreation represents an index creation
TaskTypeIndexCreation TaskType = "indexCreation"
// TaskTypeIndexUpdate represents an index update
TaskTypeIndexUpdate TaskType = "indexUpdate"
// TaskTypeIndexDeletion represents an index deletion
TaskTypeIndexDeletion TaskType = "indexDeletion"
// TaskTypeIndexSwap represents an index swap
TaskTypeIndexSwap TaskType = "indexSwap"
// TaskTypeDocumentAdditionOrUpdate represents a document addition or update in an index
TaskTypeDocumentAdditionOrUpdate TaskType = "documentAdditionOrUpdate"
// TaskTypeDocumentDeletion represents a document deletion from an index
TaskTypeDocumentDeletion TaskType = "documentDeletion"
// TaskTypeSettingsUpdate represents a settings update
TaskTypeSettingsUpdate TaskType = "settingsUpdate"
// TaskTypeDumpCreation represents a dump creation
TaskTypeDumpCreation TaskType = "dumpCreation"
// TaskTypeTaskCancelation represents a task cancelation
TaskTypeTaskCancelation TaskType = "taskCancelation"
// TaskTypeTaskDeletion represents a task deletion
TaskTypeTaskDeletion TaskType = "taskDeletion"
// TaskTypeSnapshotCreation represents a snapshot creation
TaskTypeSnapshotCreation TaskType = "snapshotCreation"
)
// Task indicates information about a task resource
//
// Documentation: https://www.meilisearch.com/docs/learn/advanced/asynchronous_operations
type Task struct {
Status TaskStatus `json:"status"`
UID int64 `json:"uid,omitempty"`
TaskUID int64 `json:"taskUid,omitempty"`
IndexUID string `json:"indexUid"`
Type TaskType `json:"type"`
Error meilisearchApiError `json:"error,omitempty"`
Duration string `json:"duration,omitempty"`
EnqueuedAt time.Time `json:"enqueuedAt"`
StartedAt time.Time `json:"startedAt,omitempty"`
FinishedAt time.Time `json:"finishedAt,omitempty"`
Details Details `json:"details,omitempty"`
CanceledBy int64 `json:"canceledBy,omitempty"`
}
// TaskInfo indicates information regarding a task returned by an asynchronous method
//
// Documentation: https://www.meilisearch.com/docs/reference/api/tasks#tasks
type TaskInfo struct {
Status TaskStatus `json:"status"`
TaskUID int64 `json:"taskUid"`
IndexUID string `json:"indexUid"`
Type TaskType `json:"type"`
EnqueuedAt time.Time `json:"enqueuedAt"`
}
// TasksQuery is a list of filter available to send as query parameters
type TasksQuery struct {
UIDS []int64
Limit int64
From int64
IndexUIDS []string
Statuses []TaskStatus
Types []TaskType
CanceledBy []int64
BeforeEnqueuedAt time.Time
AfterEnqueuedAt time.Time
BeforeStartedAt time.Time
AfterStartedAt time.Time
BeforeFinishedAt time.Time
AfterFinishedAt time.Time
}
// CancelTasksQuery is a list of filter available to send as query parameters
type CancelTasksQuery struct {
UIDS []int64
IndexUIDS []string
Statuses []TaskStatus
Types []TaskType
BeforeEnqueuedAt time.Time
AfterEnqueuedAt time.Time
BeforeStartedAt time.Time
AfterStartedAt time.Time
}
// DeleteTasksQuery is a list of filter available to send as query parameters
type DeleteTasksQuery struct {
UIDS []int64
IndexUIDS []string
Statuses []TaskStatus
Types []TaskType
CanceledBy []int64
BeforeEnqueuedAt time.Time
AfterEnqueuedAt time.Time
BeforeStartedAt time.Time
AfterStartedAt time.Time
BeforeFinishedAt time.Time
AfterFinishedAt time.Time
}
type Details struct {
ReceivedDocuments int64 `json:"receivedDocuments,omitempty"`
IndexedDocuments int64 `json:"indexedDocuments,omitempty"`
DeletedDocuments int64 `json:"deletedDocuments,omitempty"`
PrimaryKey string `json:"primaryKey,omitempty"`
ProvidedIds int64 `json:"providedIds,omitempty"`
RankingRules []string `json:"rankingRules,omitempty"`
DistinctAttribute *string `json:"distinctAttribute,omitempty"`
SearchableAttributes []string `json:"searchableAttributes,omitempty"`
DisplayedAttributes []string `json:"displayedAttributes,omitempty"`
StopWords []string `json:"stopWords,omitempty"`
Synonyms map[string][]string `json:"synonyms,omitempty"`
FilterableAttributes []string `json:"filterableAttributes,omitempty"`
SortableAttributes []string `json:"sortableAttributes,omitempty"`
TypoTolerance *TypoTolerance `json:"typoTolerance,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
Faceting *Faceting `json:"faceting,omitempty"`
MatchedTasks int64 `json:"matchedTasks,omitempty"`
CanceledTasks int64 `json:"canceledTasks,omitempty"`
DeletedTasks int64 `json:"deletedTasks,omitempty"`
OriginalFilter string `json:"originalFilter,omitempty"`
Swaps []SwapIndexesParams `json:"swaps,omitempty"`
DumpUid string `json:"dumpUid,omitempty"`
}
// TaskResult return of multiple tasks is wrap in a TaskResult
type TaskResult struct {
Results []Task `json:"results"`
Limit int64 `json:"limit"`
From int64 `json:"from"`
Next int64 `json:"next"`
Total int64 `json:"total"`
}
// Key allow the user to connect to the meilisearch instance
//
// Documentation: https://www.meilisearch.com/docs/learn/security/master_api_keys#protecting-a-meilisearch-instance
type Key struct {
Name string `json:"name"`
Description string `json:"description"`
Key string `json:"key,omitempty"`
UID string `json:"uid,omitempty"`
Actions []string `json:"actions,omitempty"`
Indexes []string `json:"indexes,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
ExpiresAt time.Time `json:"expiresAt"`
}
// KeyParsed this structure is used to send the exact ISO-8601 time format managed by meilisearch
type KeyParsed struct {
Name string `json:"name"`
Description string `json:"description"`
UID string `json:"uid,omitempty"`
Actions []string `json:"actions,omitempty"`
Indexes []string `json:"indexes,omitempty"`
ExpiresAt *string `json:"expiresAt"`
}
// KeyUpdate this structure is used to update a Key
type KeyUpdate struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
}
// KeysResults return of multiple keys is wrap in a KeysResults
type KeysResults struct {
Results []Key `json:"results"`
Offset int64 `json:"offset"`
Limit int64 `json:"limit"`
Total int64 `json:"total"`
}
type KeysQuery struct {
Limit int64
Offset int64
}
// TenantTokenOptions information to create a tenant token
//
// ExpiresAt is a time.Time when the key will expire.
// Note that if an ExpiresAt value is included it should be in UTC time.
// ApiKey is the API key parent of the token.
type TenantTokenOptions struct {
APIKey string
ExpiresAt time.Time
}
// TenantTokenClaims custom Claims structure to create a Tenant Token
type TenantTokenClaims struct {
APIKeyUID string `json:"apiKeyUid"`
SearchRules interface{} `json:"searchRules"`
jwt.RegisteredClaims
}
//
// Request/Response
//
// CreateIndexRequest is the request body for create index method
type CreateIndexRequest struct {
UID string `json:"uid,omitempty"`
PrimaryKey string `json:"primaryKey,omitempty"`
}
// SearchRequest is the request url param needed for a search query.
// This struct will be converted to url param before sent.
//
// Documentation: https://www.meilisearch.com/docs/reference/api/search#search-parameters
type SearchRequest struct {
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"`
AttributesToSearchOn []string `json:"attributesToSearchOn,omitempty"`
AttributesToCrop []string `json:"attributesToCrop,omitempty"`
CropLength int64 `json:"cropLength,omitempty"`
CropMarker string `json:"cropMarker,omitempty"`
AttributesToHighlight []string `json:"attributesToHighlight,omitempty"`
HighlightPreTag string `json:"highlightPreTag,omitempty"`
HighlightPostTag string `json:"highlightPostTag,omitempty"`
MatchingStrategy MatchingStrategy `json:"matchingStrategy,omitempty"`
Filter interface{} `json:"filter,omitempty"`
ShowMatchesPosition bool `json:"showMatchesPosition,omitempty"`
ShowRankingScore bool `json:"showRankingScore,omitempty"`
ShowRankingScoreDetails bool `json:"showRankingScoreDetails,omitempty"`
Facets []string `json:"facets,omitempty"`
Sort []string `json:"sort,omitempty"`
Vector []float32 `json:"vector,omitempty"`
HitsPerPage int64 `json:"hitsPerPage,omitempty"`
Page int64 `json:"page,omitempty"`
IndexUID string `json:"indexUid,omitempty"`
Query string `json:"q"`
Distinct string `json:"distinct,omitempty"`
Hybrid *SearchRequestHybrid `json:"hybrid"`
RetrieveVectors bool `json:"retrieveVectors,omitempty"`
RankingScoreThreshold float64 `json:"rankingScoreThreshold,omitempty"`
FederationOptions *SearchFederationOptions `json:"federationOptions,omitempty"`
Locates []string `json:"locales,omitempty"`
}
type SearchFederationOptions struct {
Weight float64 `json:"weight"`
}
type SearchRequestHybrid struct {
SemanticRatio float64 `json:"semanticRatio,omitempty"`
Embedder string `json:"embedder"`
}
type MultiSearchRequest struct {
Federation *MultiSearchFederation `json:"federation,omitempty"`
Queries []*SearchRequest `json:"queries"`
}
type MultiSearchFederation struct {
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
}
// SearchResponse is the response body for search method
type SearchResponse struct {
Hits []interface{} `json:"hits"`
EstimatedTotalHits int64 `json:"estimatedTotalHits,omitempty"`
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
ProcessingTimeMs int64 `json:"processingTimeMs"`
Query string `json:"query"`
FacetDistribution interface{} `json:"facetDistribution,omitempty"`
TotalHits int64 `json:"totalHits,omitempty"`
HitsPerPage int64 `json:"hitsPerPage,omitempty"`
Page int64 `json:"page,omitempty"`
TotalPages int64 `json:"totalPages,omitempty"`
FacetStats interface{} `json:"facetStats,omitempty"`
IndexUID string `json:"indexUid,omitempty"`
}
type MultiSearchResponse struct {
Results []SearchResponse `json:"results,omitempty"`
Hits []interface{} `json:"hits,omitempty"`
ProcessingTimeMs int64 `json:"processingTimeMs,omitempty"`
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
EstimatedTotalHits int64 `json:"estimatedTotalHits,omitempty"`
SemanticHitCount int64 `json:"semanticHitCount,omitempty"`
}
type FacetSearchRequest struct {
FacetName string `json:"facetName,omitempty"`
FacetQuery string `json:"facetQuery,omitempty"`
Q string `json:"q,omitempty"`
Filter string `json:"filter,omitempty"`
MatchingStrategy string `json:"matchingStrategy,omitempty"`
AttributesToSearchOn []string `json:"attributesToSearchOn,omitempty"`
}
type FacetSearchResponse struct {
FacetHits []interface{} `json:"facetHits"`
FacetQuery string `json:"facetQuery"`
ProcessingTimeMs int64 `json:"processingTimeMs"`
}
// DocumentQuery is the request body get one documents method
type DocumentQuery struct {
Fields []string `json:"fields,omitempty"`
}
// DocumentsQuery is the request body for list documents method
type DocumentsQuery struct {
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
Fields []string `json:"fields,omitempty"`
Filter interface{} `json:"filter,omitempty"`
}
// SimilarDocumentQuery is query parameters of similar documents
type SimilarDocumentQuery struct {
Id interface{} `json:"id,omitempty"`
Embedder string `json:"embedder"`
AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"`
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
Filter string `json:"filter,omitempty"`
ShowRankingScore bool `json:"showRankingScore,omitempty"`
ShowRankingScoreDetails bool `json:"showRankingScoreDetails,omitempty"`
RankingScoreThreshold float64 `json:"rankingScoreThreshold,omitempty"`
RetrieveVectors bool `json:"retrieveVectors,omitempty"`
}
type SimilarDocumentResult struct {
Hits []interface{} `json:"hits,omitempty"`
ID string `json:"id,omitempty"`
ProcessingTimeMS int64 `json:"processingTimeMs,omitempty"`
Limit int64 `json:"limit,omitempty"`
Offset int64 `json:"offset,omitempty"`
EstimatedTotalHits int64 `json:"estimatedTotalHits,omitempty"`
}
type CsvDocumentsQuery struct {
PrimaryKey string `json:"primaryKey,omitempty"`
CsvDelimiter string `json:"csvDelimiter,omitempty"`
}
type DocumentsResult struct {
Results []map[string]interface{} `json:"results"`
Limit int64 `json:"limit"`
Offset int64 `json:"offset"`
Total int64 `json:"total"`
}
type UpdateDocumentByFunctionRequest struct {
Filter string `json:"filter,omitempty"`
Function string `json:"function"`
Context map[string]interface{} `json:"context,omitempty"`
}
// ExperimentalFeaturesResult represents the experimental features result from the API.
type ExperimentalFeaturesBase struct {
VectorStore *bool `json:"vectorStore,omitempty"`
LogsRoute *bool `json:"logsRoute,omitempty"`
Metrics *bool `json:"metrics,omitempty"`
EditDocumentsByFunction *bool `json:"editDocumentsByFunction,omitempty"`
ContainsFilter *bool `json:"containsFilter,omitempty"`
}
type ExperimentalFeaturesResult struct {
VectorStore bool `json:"vectorStore"`
LogsRoute bool `json:"logsRoute"`
Metrics bool `json:"metrics"`
EditDocumentsByFunction bool `json:"editDocumentsByFunction"`
ContainsFilter bool `json:"containsFilter"`
}
type SwapIndexesParams struct {
Indexes []string `json:"indexes"`
}
// RawType is an alias for raw byte[]
type RawType []byte
// Health is the request body for set meilisearch health
type Health struct {
Status string `json:"status"`
}
// UpdateIndexRequest is the request body for update Index primary key
type UpdateIndexRequest struct {
PrimaryKey string `json:"primaryKey"`
}
// Unknown is unknown json type
type Unknown map[string]interface{}
// UnmarshalJSON supports json.Unmarshaler interface
func (b *RawType) UnmarshalJSON(data []byte) error {
*b = data
return nil
}
// MarshalJSON supports json.Marshaler interface
func (b RawType) MarshalJSON() ([]byte, error) {
return b, nil
}
func (s *SearchRequest) validate() {
if s.Hybrid != nil && s.Hybrid.Embedder == "" {
s.Hybrid.Embedder = "default"
}
}