File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -436,3 +436,29 @@ def test_search_on_nested_documents_with_sortable_attributes(index_with_document
436
436
)
437
437
assert isinstance (response , dict )
438
438
assert response ['hits' ][0 ]['id' ] == 6
439
+
440
+ def test_custom_search_params_with_matching_strategy_all (index_with_documents ):
441
+ """Tests search with matching strategy param set to all"""
442
+ response = index_with_documents ().search (
443
+ 'man loves' ,
444
+ {
445
+ 'limit' : 5 ,
446
+ 'matchingStrategy' : 'all' ,
447
+ }
448
+ )
449
+
450
+ assert isinstance (response , dict )
451
+ assert len (response ['hits' ]) == 1
452
+
453
+ def test_custom_search_params_with_matching_strategy_last (index_with_documents ):
454
+ """Tests search with matching strategy param set to last"""
455
+ response = index_with_documents ().search (
456
+ 'man loves' ,
457
+ {
458
+ 'limit' : 5 ,
459
+ 'matchingStrategy' : 'last' ,
460
+ }
461
+ )
462
+
463
+ assert isinstance (response , dict )
464
+ assert len (response ['hits' ]) > 1
You can’t perform that action at this time.
0 commit comments