@@ -186,18 +186,16 @@ def test_custom_search_params_with_facets_distribution(index_with_documents):
186
186
response = index .search (
187
187
'world' ,
188
188
{
189
- 'facetsDistribution ' : ['genre' ]
189
+ 'facets ' : ['genre' ]
190
190
}
191
191
)
192
192
assert isinstance (response , dict )
193
193
assert len (response ['hits' ]) == 12
194
- assert 'facetsDistribution' in response
195
- assert 'exhaustiveFacetsCount' in response
196
- assert not response ['exhaustiveFacetsCount' ]
197
- assert 'genre' in response ['facetsDistribution' ]
198
- assert response ['facetsDistribution' ]['genre' ]['cartoon' ] == 1
199
- assert response ['facetsDistribution' ]['genre' ]['action' ] == 3
200
- assert response ['facetsDistribution' ]['genre' ]['fantasy' ] == 1
194
+ assert 'facetDistribution' in response
195
+ assert 'genre' in response ['facetDistribution' ]
196
+ assert response ['facetDistribution' ]['genre' ]['cartoon' ] == 1
197
+ assert response ['facetDistribution' ]['genre' ]['action' ] == 3
198
+ assert response ['facetDistribution' ]['genre' ]['fantasy' ] == 1
201
199
202
200
def test_custom_search_params_with_filter_string (index_with_documents ):
203
201
index = index_with_documents ()
@@ -211,8 +209,7 @@ def test_custom_search_params_with_filter_string(index_with_documents):
211
209
)
212
210
assert isinstance (response , dict )
213
211
assert len (response ['hits' ]) == 3
214
- assert 'facetsDistribution' not in response
215
- assert 'exhaustiveFacetsCount' not in response
212
+ assert 'facetDistribution' not in response
216
213
217
214
def test_custom_search_params_with_filter_string_with_space (index_with_documents ):
218
215
index = index_with_documents ()
@@ -226,8 +223,7 @@ def test_custom_search_params_with_filter_string_with_space(index_with_documents
226
223
)
227
224
assert isinstance (response , dict )
228
225
assert len (response ['hits' ]) == 1
229
- assert 'facetsDistribution' not in response
230
- assert 'exhaustiveFacetsCount' not in response
226
+ assert 'facetDistribution' not in response
231
227
232
228
def test_custom_search_params_with_multiple_filter_string_with_space (index_with_documents ):
233
229
index = index_with_documents ()
@@ -241,8 +237,7 @@ def test_custom_search_params_with_multiple_filter_string_with_space(index_with_
241
237
)
242
238
assert isinstance (response , dict )
243
239
assert len (response ['hits' ]) == 1
244
- assert 'facetsDistribution' not in response
245
- assert 'exhaustiveFacetsCount' not in response
240
+ assert 'facetDistribution' not in response
246
241
247
242
def test_custom_search_params_with_array_filter_with_space (index_with_documents ):
248
243
index = index_with_documents ()
@@ -256,8 +251,7 @@ def test_custom_search_params_with_array_filter_with_space(index_with_documents)
256
251
)
257
252
assert isinstance (response , dict )
258
253
assert len (response ['hits' ]) == 1
259
- assert 'facetsDistribution' not in response
260
- assert 'exhaustiveFacetsCount' not in response
254
+ assert 'facetDistribution' not in response
261
255
262
256
def test_custom_search_params_with_mutilple_filter_string (index_with_documents ):
263
257
index = index_with_documents ()
@@ -271,8 +265,7 @@ def test_custom_search_params_with_mutilple_filter_string(index_with_documents):
271
265
)
272
266
assert isinstance (response , dict )
273
267
assert len (response ['hits' ]) == 2
274
- assert 'facetsDistribution' not in response
275
- assert 'exhaustiveFacetsCount' not in response
268
+ assert 'facetDistribution' not in response
276
269
assert response ['hits' ][0 ]['title' ] == 'Avengers: Infinity War'
277
270
278
271
def test_custom_search_params_with_filter (index_with_documents ):
@@ -287,8 +280,7 @@ def test_custom_search_params_with_filter(index_with_documents):
287
280
)
288
281
assert isinstance (response , dict )
289
282
assert len (response ['hits' ]) == 3
290
- assert 'facetsDistribution' not in response
291
- assert 'exhaustiveFacetsCount' not in response
283
+ assert 'facetDistribution' not in response
292
284
293
285
def test_custom_search_params_with_multiple_filter (index_with_documents ):
294
286
index = index_with_documents ()
@@ -302,8 +294,7 @@ def test_custom_search_params_with_multiple_filter(index_with_documents):
302
294
)
303
295
assert isinstance (response , dict )
304
296
assert len (response ['hits' ]) == 3
305
- assert 'facetsDistribution' not in response
306
- assert 'exhaustiveFacetsCount' not in response
297
+ assert 'facetDistribution' not in response
307
298
308
299
def test_custom_search_params_with_many_params (index_with_documents ):
309
300
index = index_with_documents ()
@@ -318,8 +309,7 @@ def test_custom_search_params_with_many_params(index_with_documents):
318
309
)
319
310
assert isinstance (response , dict )
320
311
assert len (response ['hits' ]) == 3
321
- assert 'facetsDistribution' not in response
322
- assert 'exhaustiveFacetsCount' not in response
312
+ assert 'facetDistribution' not in response
323
313
assert 'title' in response ['hits' ][0 ]
324
314
assert 'poster' in response ['hits' ][0 ]
325
315
assert 'overview' not in response ['hits' ][0 ]
@@ -347,8 +337,7 @@ def test_custom_search_params_with_sort_string(index_with_documents):
347
337
)
348
338
assert isinstance (response , dict )
349
339
assert len (response ['hits' ]) == 12
350
- assert 'facetsDistribution' not in response
351
- assert 'exhaustiveFacetsCount' not in response
340
+ assert 'facetDistribution' not in response
352
341
assert response ['hits' ][0 ]['title' ] == 'Alita: Battle Angel'
353
342
assert response ['hits' ][1 ]['title' ] == 'Aquaman'
354
343
@@ -373,8 +362,7 @@ def test_custom_search_params_with_sort_int(index_with_documents):
373
362
)
374
363
assert isinstance (response , dict )
375
364
assert len (response ['hits' ]) == 12
376
- assert 'facetsDistribution' not in response
377
- assert 'exhaustiveFacetsCount' not in response
365
+ assert 'facetDistribution' not in response
378
366
assert response ['hits' ][0 ]['title' ] == 'Avengers: Infinity War'
379
367
assert response ['hits' ][1 ]['title' ] == 'Redcon-1'
380
368
@@ -399,17 +387,15 @@ def test_custom_search_params_with_multiple_sort(index_with_documents):
399
387
)
400
388
assert isinstance (response , dict )
401
389
assert len (response ['hits' ]) == 12
402
- assert 'facetsDistribution' not in response
403
- assert 'exhaustiveFacetsCount' not in response
390
+ assert 'facetDistribution' not in response
404
391
assert response ['hits' ][0 ]['title' ] == 'Alita: Battle Angel'
405
392
assert response ['hits' ][1 ]['title' ] == 'Aquaman'
406
393
407
394
def test_phrase_search (index_with_documents ):
408
395
response = index_with_documents ().search ('coco "dumbo"' )
409
396
assert isinstance (response , dict )
410
397
assert len (response ['hits' ]) == 1
411
- assert 'facetsDistribution' not in response
412
- assert 'exhaustiveFacetsCount' not in response
398
+ assert 'facetDistribution' not in response
413
399
assert 'title' in response ['hits' ][0 ]
414
400
assert 'poster' in response ['hits' ][0 ]
415
401
assert 'overview' in response ['hits' ][0 ]
0 commit comments