Skip to content

Commit 492cf91

Browse files
committed
Add exhaustiveNbHits to SearchResponse
1 parent 5dc4179 commit 492cf91

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export interface SearchResponse<T, P extends SearchParams<T>> {
105105
exhaustiveFacetsCount?: boolean
106106
query: string
107107
nbHits: number
108+
exhaustiveNbHits: boolean
108109
}
109110

110111
export interface FieldsDistribution {

tests/search_tests.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ describe.each([
362362
genre: { adventure: 0, fantasy: 0, romance: 2, 'sci fi': 0 },
363363
})
364364
expect(response).toHaveProperty('exhaustiveFacetsCount', true)
365+
expect(response).toHaveProperty('exhaustiveNbHits', false)
365366
expect(response).toHaveProperty('hits', expect.any(Array))
366367
expect(response.hits.length).toEqual(2)
367368
})
@@ -399,6 +400,7 @@ describe.each([
399400
genre: { adventure: 0, fantasy: 0, romance: 2, 'sci fi': 0 },
400401
})
401402
expect(response).toHaveProperty('exhaustiveFacetsCount', true)
403+
expect(response).toHaveProperty('exhaustiveNbHits', false)
402404
expect(response).toHaveProperty('hits', expect.any(Array))
403405
expect(response.hits.length).toEqual(2)
404406
})

0 commit comments

Comments
 (0)