@@ -108,6 +108,9 @@ export type HybridSearch = {
108108 semanticRatio ?: number ;
109109} ;
110110
111+ // https://www.meilisearch.com/docs/reference/api/settings#localized-attributes
112+ export type Locale = string ;
113+
111114export type SearchParams = Query &
112115 Pagination &
113116 Highlight &
@@ -130,6 +133,7 @@ export type SearchParams = Query &
130133 hybrid ?: HybridSearch ;
131134 distinct ?: string ;
132135 retrieveVectors ?: boolean ;
136+ locales ?: Locale [ ] ;
133137 } ;
134138
135139// Search parameters for searches made with the GET method
@@ -152,13 +156,24 @@ export type SearchRequestGET = Pagination &
152156 rankingScoreThreshold ?: number ;
153157 distinct ?: string ;
154158 retrieveVectors ?: boolean ;
159+ locales ?: Locale [ ] ;
155160 } ;
156161
162+ export type FederationOptions = { weight : number } ;
163+ export type MultiSearchFederation = { limit ?: number ; offset ?: number } ;
164+
157165export type MultiSearchQuery = SearchParams & { indexUid : string } ;
166+ export type MultiSearchQueryWithFederation = MultiSearchQuery & {
167+ federationOptions ?: FederationOptions ;
168+ } ;
158169
159170export type MultiSearchParams = {
160171 queries : MultiSearchQuery [ ] ;
161172} ;
173+ export type FederatedMultiSearchParams = {
174+ federation : MultiSearchFederation ;
175+ queries : MultiSearchQueryWithFederation [ ] ;
176+ } ;
162177
163178export type CategoriesDistribution = {
164179 [ category : string ] : number ;
@@ -170,13 +185,6 @@ export type MatchesPosition<T> = Partial<
170185 Record < keyof T , Array < { start : number ; length : number } > >
171186> ;
172187
173- export type Hit < T = Record < string , any > > = T & {
174- _formatted ?: Partial < T > ;
175- _matchesPosition ?: MatchesPosition < T > ;
176- _rankingScore ?: number ;
177- _rankingScoreDetails ?: RankingScoreDetails ;
178- } ;
179-
180188export type RankingScoreDetails = {
181189 words ?: {
182190 order : number ;
@@ -208,6 +216,20 @@ export type RankingScoreDetails = {
208216 [ key : string ] : Record < string , any > | undefined ;
209217} ;
210218
219+ export type FederationDetails = {
220+ indexUid : string ;
221+ queriesPosition : number ;
222+ weightedRankingScore : number ;
223+ } ;
224+
225+ export type Hit < T = Record < string , any > > = T & {
226+ _formatted ?: Partial < T > ;
227+ _matchesPosition ?: MatchesPosition < T > ;
228+ _rankingScore ?: number ;
229+ _rankingScoreDetails ?: RankingScoreDetails ;
230+ _federation ?: FederationDetails ;
231+ } ;
232+
211233export type Hits < T = Record < string , any > > = Array < Hit < T > > ;
212234
213235export type FacetStat = { min : number ; max : number } ;
@@ -326,6 +348,12 @@ export type DocumentsDeletionQuery = {
326348
327349export type DocumentsIds = string [ ] | number [ ] ;
328350
351+ export type UpdateDocumentsByFunctionOptions = {
352+ function : string ;
353+ filter ?: string | string [ ] ;
354+ context ?: Record < string , any > ;
355+ } ;
356+
329357/*
330358 ** Settings
331359 */
@@ -366,6 +394,7 @@ export type OpenAiEmbedder = {
366394 documentTemplate ?: string ;
367395 dimensions ?: number ;
368396 distribution ?: Distribution ;
397+ url ?: string ;
369398} ;
370399
371400export type HuggingFaceEmbedder = {
@@ -388,12 +417,10 @@ export type RestEmbedder = {
388417 apiKey ?: string ;
389418 dimensions ?: number ;
390419 documentTemplate ?: string ;
391- inputField ?: string [ ] | null ;
392- inputType ?: 'text' | 'textArray' ;
393- query ?: Record < string , any > | null ;
394- pathToEmbeddings ?: string [ ] | null ;
395- embeddingObject ?: string [ ] | null ;
396420 distribution ?: Distribution ;
421+ request : Record < string , any > ;
422+ response : Record < string , any > ;
423+ headers ?: Record < string , string > ;
397424} ;
398425
399426export type OllamaEmbedder = {
@@ -403,6 +430,7 @@ export type OllamaEmbedder = {
403430 model ?: string ;
404431 documentTemplate ?: string ;
405432 distribution ?: Distribution ;
433+ dimensions ?: number ;
406434} ;
407435
408436export type Embedder =
@@ -428,6 +456,13 @@ export type PaginationSettings = {
428456
429457export type SearchCutoffMs = number | null ;
430458
459+ export type LocalizedAttribute = {
460+ attributePatterns : string [ ] ;
461+ locales : Locale [ ] ;
462+ } ;
463+
464+ export type LocalizedAttributes = LocalizedAttribute [ ] | null ;
465+
431466export type Settings = {
432467 filterableAttributes ?: FilterableAttributes ;
433468 distinctAttribute ?: DistinctAttribute ;
@@ -446,6 +481,7 @@ export type Settings = {
446481 proximityPrecision ?: ProximityPrecision ;
447482 embedders ?: Embedders ;
448483 searchCutoffMs ?: SearchCutoffMs ;
484+ localizedAttributes ?: LocalizedAttributes ;
449485} ;
450486
451487/*
@@ -677,9 +713,9 @@ export interface FetchError extends Error {
677713
678714export type MeiliSearchErrorResponse = {
679715 message : string ;
680- // @TODO : Could be typed, but will it be kept updated? https://www.meilisearch.com/docs/reference/errors/error_codes
716+ // https://www.meilisearch.com/docs/reference/errors/error_codes
681717 code : string ;
682- // @TODO : Could be typed https://www.meilisearch.com/docs/reference/errors/overview#errors
718+ // https://www.meilisearch.com/docs/reference/errors/overview#errors
683719 type : string ;
684720 link : string ;
685721} ;
@@ -992,6 +1028,10 @@ export const ErrorStatusCode = {
9921028 /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_search_cutoff_ms */
9931029 INVALID_SETTINGS_SEARCH_CUTOFF_MS : 'invalid_settings_search_cutoff_ms' ,
9941030
1031+ /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_settings_search_cutoff_ms */
1032+ INVALID_SETTINGS_LOCALIZED_ATTRIBUTES :
1033+ 'invalid_settings_localized_attributes' ,
1034+
9951035 /** @see https://www.meilisearch.com/docs/reference/errors/error_codes#invalid_task_before_enqueued_at */
9961036 INVALID_TASK_BEFORE_ENQUEUED_AT : 'invalid_task_before_enqueued_at' ,
9971037
0 commit comments