Skip to content

Commit

Permalink
Add exhaustiveNbHits to SearchResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
bb committed Nov 11, 2020
1 parent 5dc4179 commit 492cf91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export interface SearchResponse<T, P extends SearchParams<T>> {
exhaustiveFacetsCount?: boolean
query: string
nbHits: number
exhaustiveNbHits: boolean
}

export interface FieldsDistribution {
Expand Down
2 changes: 2 additions & 0 deletions tests/search_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ describe.each([
genre: { adventure: 0, fantasy: 0, romance: 2, 'sci fi': 0 },
})
expect(response).toHaveProperty('exhaustiveFacetsCount', true)
expect(response).toHaveProperty('exhaustiveNbHits', false)
expect(response).toHaveProperty('hits', expect.any(Array))
expect(response.hits.length).toEqual(2)
})
Expand Down Expand Up @@ -399,6 +400,7 @@ describe.each([
genre: { adventure: 0, fantasy: 0, romance: 2, 'sci fi': 0 },
})
expect(response).toHaveProperty('exhaustiveFacetsCount', true)
expect(response).toHaveProperty('exhaustiveNbHits', false)
expect(response).toHaveProperty('hits', expect.any(Array))
expect(response.hits.length).toEqual(2)
})
Expand Down

0 comments on commit 492cf91

Please sign in to comment.