File tree Expand file tree Collapse file tree 3 files changed +2
-17
lines changed Expand file tree Collapse file tree 3 files changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,6 @@ export function extractFacets(
81
81
searchContext : SearchContext ,
82
82
searchParams : MeiliSearchParams
83
83
) : FacetsCache {
84
- // console.log(searchContext.keepZeroFacets)
85
-
86
84
if ( searchContext . keepZeroFacets ) {
87
85
return getFacetsFromDefaultDistribution (
88
86
searchContext . defaultFacetDistribution
@@ -108,19 +106,14 @@ export function addMissingFacets(
108
106
) : FacetDistribution {
109
107
distribution = distribution || { }
110
108
111
- // console.log({ distribution })
112
109
// If cachedFacets contains something
113
110
if ( cachedFacets && Object . keys ( cachedFacets ) . length > 0 ) {
114
111
// for all filters in cached filters
115
112
for ( const cachedFacet in cachedFacets ) {
116
- // console.log({ cachedFacet })
117
-
118
113
// if facet does not exist on returned distribution, add an empty object
119
114
if ( ! distribution [ cachedFacet ] ) distribution [ cachedFacet ] = { }
120
115
// for all fields in every filter
121
116
for ( const cachedField of cachedFacets [ cachedFacet ] ) {
122
- // console.log({ cachedField })
123
-
124
117
// if the field is not present in the returned distribution
125
118
// set it at 0
126
119
if ( ! Object . keys ( distribution [ cachedFacet ] ) . includes ( cachedField ) ) {
Original file line number Diff line number Diff line change @@ -37,13 +37,7 @@ export function SearchResolver(
37
37
const cachedResponse = cache . getEntry ( key )
38
38
39
39
// Check if specific request is already cached with its associated search response.
40
- if ( cachedResponse ) {
41
- // console.log('cache')
42
-
43
- return cachedResponse
44
- }
45
-
46
- // console.log('searchRequest')
40
+ if ( cachedResponse ) return cachedResponse
47
41
48
42
// Make search request
49
43
const searchResponse = await client
@@ -52,7 +46,7 @@ export function SearchResolver(
52
46
53
47
if ( searchContext . keepZeroFacets ) {
54
48
const cachedFacets = extractFacets ( searchContext , searchParams )
55
- // console.log({ cachedFacets })
49
+
56
50
// Add missing facets back into facetDistribution
57
51
searchResponse . facetDistribution = addMissingFacets (
58
52
cachedFacets ,
Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ export function adaptPaginationParameters(
26
26
searchResponse : MeiliSearchResponse < Record < string , any > > ,
27
27
paginationState : PaginationState
28
28
) : InstantSearchPagination & { nbPages : number } {
29
- // console.log({ paginationState })
30
-
31
29
const { hitsPerPage, page } = paginationState
32
30
const nbPages = adaptNbPages ( searchResponse , hitsPerPage )
33
31
You can’t perform that action at this time.
0 commit comments