@@ -21,22 +21,16 @@ export function adaptSearchResponse<T>(
21
21
) : { results : Array < AlgoliaSearchResponse < T > > } {
22
22
const searchResponseOptionals : Record < string , any > = { }
23
23
24
- const facets = searchResponse . facetsDistribution
24
+ const facets = searchResponse . facetDistribution
25
25
const { pagination } = searchContext
26
26
27
- const exhaustiveFacetsCount = searchResponse ?. exhaustiveFacetsCount
28
- if ( exhaustiveFacetsCount ) {
29
- searchResponseOptionals . exhaustiveFacetsCount = exhaustiveFacetsCount
30
- }
31
-
32
27
const nbPages = ceiledDivision (
33
28
searchResponse . hits . length ,
34
29
pagination . hitsPerPage
35
30
)
36
31
const hits = adaptHits ( searchResponse . hits , searchContext , pagination )
37
32
38
- const exhaustiveNbHits = searchResponse . exhaustiveNbHits
39
- const nbHits = searchResponse . nbHits
33
+ const estimatedTotalHits = searchResponse . estimatedTotalHits
40
34
const processingTimeMs = searchResponse . processingTimeMs
41
35
const query = searchResponse . query
42
36
@@ -49,12 +43,12 @@ export function adaptSearchResponse<T>(
49
43
page,
50
44
facets,
51
45
nbPages,
52
- exhaustiveNbHits,
53
- nbHits,
46
+ nbHits : estimatedTotalHits ,
54
47
processingTimeMS : processingTimeMs ,
55
48
query,
56
49
hits,
57
50
params : '' ,
51
+ exhaustiveNbHits : false ,
58
52
...searchResponseOptionals ,
59
53
}
60
54
return {
0 commit comments