Skip to content
9 changes: 9 additions & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ export type TypoTolerance = {
}
} | null

export type Faceting = {
maxValuesPerFacet?: number | null
}
export type PaginationSettings = {
maxTotalHits?: number | null
}

export type Settings = {
filterableAttributes?: FilterableAttributes
distinctAttribute?: DistinctAttribute
Expand All @@ -177,6 +184,8 @@ export type Settings = {
stopWords?: StopWords
synonyms?: Synonyms
typoTolerance?: TypoTolerance
faceting?: Faceting
pagination?: PaginationSettings
}

/*
Expand Down
12 changes: 12 additions & 0 deletions tests/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ const defaultSettings = {
disableOnWords: [],
disableOnAttributes: [],
},
pagination: {
maxTotalHits: 1000,
},
faceting: {
maxValuesPerFacet: 100,
},
}

jest.setTimeout(100 * 1000)
Expand Down Expand Up @@ -125,6 +131,12 @@ describe.each([{ permission: 'Master' }, { permission: 'Private' }])(
disableOnWords: ['prince'],
disableOnAttributes: ['comment'],
},
pagination: {
maxTotalHits: 1000,
},
faceting: {
maxValuesPerFacet: 100,
},
}
// Add the settings
const task = await client.index(index.uid).updateSettings(newSettings)
Expand Down